Created
November 9, 2021 03:35
-
-
Save mdevan/c14e43ccde6c8c00cd16c91b0909c28e to your computer and use it in GitHub Desktop.
sqlite select all columns
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 students (name text, class text, height integer); | |
sqlite> insert into students values ('Haki', 'A', 186), ('Dan', 'A', 175), ('Jax', 'A', 182), ('George', 'B', 178), ('Bill', 'B', 167), ('David', 'B', 178); | |
sqlite> select *, max(height) as tallest from students group by class; | |
┌────────┬───────┬────────┬─────────┐ | |
│ name │ class │ height │ tallest │ | |
├────────┼───────┼────────┼─────────┤ | |
│ Haki │ A │ 186 │ 186 │ | |
│ George │ B │ 178 │ 178 │ | |
└────────┴───────┴────────┴─────────┘ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment