Created
April 6, 2016 21:24
-
-
Save saml/4bde5c24aa29e5bc141abb5ab926d2cc to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| sqlite> create table things(user text, girl text, action text, date datetime); | |
| sqlite> insert into things values ('saml', 'jessica alba', 'married', datetime('now')); | |
| sqlite> insert into things values ('saml', 'jessica alba', 'divorced', datetime('now')); | |
| sqlite> insert into things values ('saml', 'sigourney weaver', 'married', datetime('now')); | |
| sqlite> insert into things values ('saml', 'sigourney weaver', 'divorced', datetime('now')); | |
| sqlite> insert into things values ('saml', 'jessica alba', 'married', datetime('now')); | |
| sqlite> select user,girl,action,max(date) from things where user = 'saml' group by girl; | |
| saml|jessica alba|married|2016-04-06 21:24:09 | |
| saml|sigourney weaver|divorced|2016-04-06 21:24:02 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment