summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbnewbold <bryan@octopart.com>2012-05-15 16:16:50 -0400
committerbnewbold <bryan@octopart.com>2012-05-15 16:16:50 -0400
commite1ca0e73b34f7786e712ec555ac440c42a91f506 (patch)
tree9ac95329e59d623f6ad0b34f5639e81ad4c9484b
parent6f4141a82de089937d6695383e2f5a23f6894d66 (diff)
downloadknowledge-e1ca0e73b34f7786e712ec555ac440c42a91f506.tar.gz
knowledge-e1ca0e73b34f7786e712ec555ac440c42a91f506.zip
films; sql tricks
-rw-r--r--film/to-watch.page3
-rw-r--r--software/sql.page13
2 files changed, 13 insertions, 3 deletions
diff --git a/film/to-watch.page b/film/to-watch.page
index 15688b2..c38b35a 100644
--- a/film/to-watch.page
+++ b/film/to-watch.page
@@ -42,4 +42,5 @@ Documentaries:
* Gasland (2010, fracking)
* Manufactured Landscapes (2006 china industrialization non-narrative)
* Mondo Cane (shock film)
-
+ * The Oath
+ * My Country, My Country
diff --git a/software/sql.page b/software/sql.page
index 5b1a72f..791fd56 100644
--- a/software/sql.page
+++ b/software/sql.page
@@ -1,9 +1,18 @@
-### SQL
+# SQL
-# MySQL-specific Tricks
+### MySQL-specific Tricks
To output in tab-delimited format, do something like:
mysql -u root -p -B < some_command.sql > output.tab
+### UPDATE with JOIN
+
+To do an update based on a join::
+
+ UPDATE tableOne t1 INNER JOIN tableTwo t2 ON t1.fk_two = t2.id SET t1.has_two = 1 WHERE t2.is_good = 1;
+
+### JOINs
+
+Useful visual summary: http://www.codeproject.com/Articles/33052/Visual-Representation-of-SQL-Joins