Skip to content

Instantly share code, notes, and snippets.

@danlark1
Last active April 18, 2022 22:03
Embed
What would you like to do?
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