Created
September 15, 2010 10:18
-
-
Save mikesimons/580525 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
QUERY: SELECT `people`.* FROM `people` WHERE (people.age < 20) AND (people.sex = "m") | |
RESULTS: | |
Name: baby joe bloggs | |
Age: 1 | |
Sex: m | |
------- | |
QUERY: SELECT `people`.* FROM `people` WHERE (people.age < 20) AND (people.sex = "f") | |
RESULTS: | |
Name: baby joanna bloggs | |
Age: 1 | |
Sex: f | |
------- | |
Name: joanna bloggs | |
Age: 17 | |
Sex: f | |
------- | |
QUERY: SELECT `people`.* FROM `people` | |
INNER JOIN `documents` AS `d` ON d.people_id = people.id WHERE (people.sex = "m") | |
RESULTS: | |
Name: mike simons | |
Age: 25 | |
Sex: m | |
------- | |
Name: joe bloggs | |
Age: 45 | |
Sex: m | |
------- | |
Name: grandpa bloggs | |
Age: 72 | |
Sex: m | |
------- | |
QUERY: SELECT `people`.* FROM `people` | |
INNER JOIN `documents` AS `d` ON d.people_id = people.id WHERE (people.sex = "m") AND (published > '2001-01-01 00:00:00') AND (published < '2005-12-31 23:59:59') | |
RESULTS: | |
Name: mike simons | |
Age: 25 | |
Sex: m | |
------- |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment