Skip to content

Instantly share code, notes, and snippets.

@danlark1
Last active April 18, 2022 22:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save danlark1/435151c8b72020667221ea08a0d36c77 to your computer and use it in GitHub Desktop.
Save danlark1/435151c8b72020667221ea08a0d36c77 to your computer and use it in GitHub Desktop.
create table example (id_1 integer, id_2 integer);
-- Insert lots of equal id_1
insert into example (id_1, id_2) values (1, 1);
insert into example (id_1, id_2) values (0, 3);
insert into example (id_1, id_2) values (0, 2);
insert into example (id_1, id_2) values (0, 3);
insert into example (id_1, id_2) values (0, 2);
insert into example (id_1, id_2) values (0, 3);
insert into example (id_1, id_2) values (1, 3);
-- Order only by the first element, second
-- is undefined for equal first elements.
select * from example order by id_1;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment