Skip to content

Instantly share code, notes, and snippets.

@binki
Created April 29, 2016 16:39
Show Gist options
  • Save binki/bc6e371b2d597a954c13a0b8c4853221 to your computer and use it in GitHub Desktop.
Save binki/bc6e371b2d597a954c13a0b8c4853221 to your computer and use it in GitHub Desktop.
SQL WHERE 1=1 as a diff-cleaning technique
ohnob@DESKTOP-A4G2C0J ~/OneDrive/repos/Main
$ diff -u .better.sql.orig .better.sql.new
--- .better.sql.orig 2016-04-29 12:37:32.586963400 -0400
+++ .better.sql.new 2016-04-29 12:37:43.936262800 -0400
@@ -1,3 +1,2 @@
WHERE 1=1
-AND Squirrels=1
AND Humans=1
$ diff -u .sql.orig .sql.new
--- .sql.orig 2016-04-29 12:37:11.101854800 -0400
+++ .sql.new 2016-04-29 12:37:15.662355200 -0400
@@ -1,2 +1 @@
-WHERE Squirrels=1
-AND Humans=1
+WHERE Humans=1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment