Created
February 13, 2017 15:31
-
-
Save florent-babylon/bd852930eff6a24274ae8401fa58c55f 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
[15:29:33]~/ λ sqlite3 test.sqlite | |
SQLite version 3.14.0 2016-07-26 15:17:14 | |
Enter ".help" for usage hints. | |
sqlite> create table test(id integer, data text); | |
sqlite> insert into test values (1, '{"test": 1}'), (2, '{"test": 2}'), (1, '{"test": 3}'), (1, '{"test": 4}'), (2, '{"test": 2}'); | |
sqlite> select id, data from test order by id; | |
1|{"test": 1} | |
1|{"test": 3} | |
1|{"test": 4} | |
2|{"test": 2} | |
2|{"test": 2} | |
sqlite> select distinct(id), GROUP_CONCAT(data) from test group by id order by id; | |
1|{"test": 1},{"test": 3},{"test": 4} | |
2|{"test": 2},{"test": 2} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment