{"id":3970,"date":"2022-03-06T16:28:08","date_gmt":"2022-03-06T16:28:08","guid":{"rendered":"https:\/\/www.gubatron.com\/blog\/?p=3970"},"modified":"2022-03-06T16:28:08","modified_gmt":"2022-03-06T16:28:08","slug":"removing-duplicate-records-from-a-table-in-sqlite3-when-delete-doesnt-support-limit-1","status":"publish","type":"post","link":"https:\/\/www.gubatron.com\/blog\/removing-duplicate-records-from-a-table-in-sqlite3-when-delete-doesnt-support-limit-1\/","title":{"rendered":"Removing duplicate records from a table in Sqlite3 when &#8220;DELETE&#8221; doesn&#8217;t support &#8220;LIMIT 1&#8221;"},"content":{"rendered":"<p><script src=\"https:\/\/gist.github.com\/gubatron\/6d7e8d8685c3fda4774ee1f61b846f88.js\"><\/script><\/p>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[15],"tags":[1651,1458,1637,1650,1649],"class_list":["post-3970","post","type-post","status-publish","format-standard","hentry","category-code","tag-databases","tag-python","tag-python3","tag-sql","tag-sqlite"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p5Unzf-122","jetpack-related-posts":[{"id":3922,"url":"https:\/\/www.gubatron.com\/blog\/python-in-functional-style-how-to-add-2-lists-of-integers-without-using-loops\/","url_meta":{"origin":3970,"position":0},"title":"Python in Functional Style: How to add 2 lists of integers without using loops","author":"gubatron","date":"January 27, 2021","format":false,"excerpt":"Usually you'd add a list of integers this way: [pastacode lang=\"python\" manual=\"a%20%3D%20%5B2%2C%202%2C%202%2C%202%5D%0Ab%20%3D%20%5B2%2C%202%2C%202%2C%202%5D%0Ac%20%3D%20%5B%5D%0Afor%20i%20in%20range(len(a))%3A%0A%20c.append(a%5Bi%5D%20%2B%20b%5Bi%5D)\" message=\"\" highlight=\"\" provider=\"manual\"\/] You can do it functionally without any loops in different ways: Using map and a lambda that adds them up [pastacode lang=\"python\" manual=\"c%20%3D%20list(map(lambda%20x%2Cy%3A%20x%2By%2C%20a%2C%20b))\" message=\"\" highlight=\"\" provider=\"manual\"\/] or you can import the add operator as a\u2026","rel":"","context":"In &quot;Code&quot;","block_context":{"text":"Code","link":"https:\/\/www.gubatron.com\/blog\/category\/code\/"},"img":{"alt_text":"Close End 10cm 80cm 5# 10pcs white Metal Zipper for Sewing ...","src":"https:\/\/external-content.duckduckgo.com\/iu\/?u=https%3A%2F%2Fae01.alicdn.com%2Fkf%2FHTB1x3GhNFXXXXaGXFXXq6xXFXXXu%2FClose-End-10cm-80cm-5-10pcs-white-Metal-Zipper-for-Sewing-zip-Garment-Accessories-Jeans-Zippers.jpg&f=1&nofb=1","width":350,"height":200},"classes":[]},{"id":1015,"url":"https:\/\/www.gubatron.com\/blog\/python-script-to-update-wordpress-in-one-step\/","url_meta":{"origin":3970,"position":1},"title":"Python Script to Update WordPress in One Step","author":"gubatron","date":"November 26, 2008","format":false,"excerpt":"During the past week, I think I had to update all my wordpress instances twice, and it's become really annoying doing this manually. I've written a python script which I'll share with you. How I keep my wordpress updated by hand I tend to keep my wp-content folder outside of\u2026","rel":"","context":"In &quot;Code&quot;","block_context":{"text":"Code","link":"https:\/\/www.gubatron.com\/blog\/category\/code\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1118,"url":"https:\/\/www.gubatron.com\/blog\/delete-all-direct-messages-of-your-twitter-account-at-once-or-at-least-try\/","url_meta":{"origin":3970,"position":2},"title":"Delete All Direct Messages of your Twitter Account at once (or at least try!)","author":"gubatron","date":"February 13, 2009","format":false,"excerpt":"Since Twitter doesn't provide with a \"Delete All Direct Messages\" functionality, Here's a Python script that attempts to delete all the direct messages stored on your Twitter account. Limitations The only problem with it is that given the limitations of the Twitter REST API, I was forced to send a\u2026","rel":"","context":"In &quot;Code&quot;","block_context":{"text":"Code","link":"https:\/\/www.gubatron.com\/blog\/category\/code\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":172,"url":"https:\/\/www.gubatron.com\/blog\/fun-with-sql-left-joins\/","url_meta":{"origin":3970,"position":3},"title":"Fun with SQL Left Joins","author":"gubatron","date":"June 22, 2005","format":false,"excerpt":"Today I spent a great deal of time trying to pull something in one fancy SQL statement. In the end, the words of my first algorithm teacher and common sense made me desist from making such a fancy SQL statement, which I still believe can be made... The problem: I\u2026","rel":"","context":"In &quot;Gubatron&quot;","block_context":{"text":"Gubatron","link":"https:\/\/www.gubatron.com\/blog\/category\/gubatron\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":516,"url":"https:\/\/www.gubatron.com\/blog\/ejemplo-de-automatizacion-entre-2-maquinas-remotas-con-bash-scripting-y-python\/","url_meta":{"origin":3970,"position":4},"title":"Ejemplo de automatizacion entre 2 maquinas remotas con bash scripting y Python","author":"gubatron","date":"May 10, 2007","format":false,"excerpt":"Para los amigos que se inician en el mundo *nix, ya sea con su nueva Mac, o con una PC corriendo Linux, les recomiendo que aprendan a manejar bien los siguientes lenguajes, y el mundo sera suyo: - bash scripting (aliases, variables, exports, iteraciones, condicionales) - python (para programar logica\u2026","rel":"","context":"In &quot;Code&quot;","block_context":{"text":"Code","link":"https:\/\/www.gubatron.com\/blog\/category\/code\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":337,"url":"https:\/\/www.gubatron.com\/blog\/porque-el-podcast-de-esta-semana-se-ha-tardado\/","url_meta":{"origin":3970,"position":5},"title":"Porque el podcast de esta semana se ha tardado.","author":"gubatron","date":"July 9, 2006","format":false,"excerpt":"Si existe un ser humano que esta haciendole seguimiento al proyecto SnowRSS, aqui puede ver los cambios realizados desde anoche. - Agregamos una tabla para almacenar informacion relacionada a los enclosures de los posts RSS. Es decir, soportaremos videocasts y podcasts. - Acomodamos de manera radical (refactoring) la forma en\u2026","rel":"","context":"In &quot;Code&quot;","block_context":{"text":"Code","link":"https:\/\/www.gubatron.com\/blog\/category\/code\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"_links":{"self":[{"href":"https:\/\/www.gubatron.com\/blog\/wp-json\/wp\/v2\/posts\/3970","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.gubatron.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.gubatron.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.gubatron.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.gubatron.com\/blog\/wp-json\/wp\/v2\/comments?post=3970"}],"version-history":[{"count":1,"href":"https:\/\/www.gubatron.com\/blog\/wp-json\/wp\/v2\/posts\/3970\/revisions"}],"predecessor-version":[{"id":3971,"href":"https:\/\/www.gubatron.com\/blog\/wp-json\/wp\/v2\/posts\/3970\/revisions\/3971"}],"wp:attachment":[{"href":"https:\/\/www.gubatron.com\/blog\/wp-json\/wp\/v2\/media?parent=3970"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.gubatron.com\/blog\/wp-json\/wp\/v2\/categories?post=3970"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.gubatron.com\/blog\/wp-json\/wp\/v2\/tags?post=3970"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}