aboutsummaryrefslogtreecommitdiffstats
path: root/README.md
diff options
context:
space:
mode:
authorMatthew Lemon <matt@matthewlemon.com>2020-07-28 09:13:32 +0100
committerMatthew Lemon <matt@matthewlemon.com>2020-07-28 09:13:32 +0100
commitf8bb6d4c574072b53040d1a8c449ba0e9ab2f62d (patch)
tree3a453816cd5f685ec8427023dadb979d15b51a63 /README.md
parentc2e2c84b55ae25791dda72d5f8c2d7f96dcf7a46 (diff)
updated README with working JOIN SQL statement
Diffstat (limited to 'README.md')
-rw-r--r--README.md5
1 files changed, 5 insertions, 0 deletions
diff --git a/README.md b/README.md
index 7ee5524..f0c37ba 100644
--- a/README.md
+++ b/README.md
@@ -11,3 +11,8 @@ Some useful queries:
`CREATE TABLE return(id INTEGER PRIMARY KEY, name TEXT, date_created TEXT);
CREATE TABLE return_data(id INTEGER PRIMARY KEY, dml_id INTEGER, value TEXT, FOREIGN KEY (dml_id) REFERENCES datamap_line(id) ON DELETE CASCADE);
`
+### This crazy join works
+`select dm.name, dml.key, dml.sheet, return.name, return_data.value from
+datamap as dm inner join datamap_line as dml on dml.dm_id=dm.id inner join
+return on return_data.ret_id=return.id inner join return_data on
+return_data.ret_id=return.id;`