Skip to content

Instantly share code, notes, and snippets.

@apatrushev
Last active September 11, 2017 12:22
Show Gist options
  • Save apatrushev/162205c7d6aa5dfec3671b39012f2bfa to your computer and use it in GitHub Desktop.
Save apatrushev/162205c7d6aa5dfec3671b39012f2bfa to your computer and use it in GitHub Desktop.
CREATE TABLE t(x INTEGER PRIMARY KEY ASC, y, z);
insert into t values (1, 2, 3);
insert into t values (2, 2, 3);
insert into t values (3, 2, 3);
insert into t values (4, 2, 3);
insert into t values (5, 2, 3);
insert into t values (6, 2, 3);
insert into t values (7, 2, 3);
insert into t values (8, 2, 3);
insert into t values (9, 2, 3);
insert into t values (10, 2, 3);
insert into t values (11, 2, 3);
insert into t values (12, 2, 3);
insert into t values (13, 2, 3);
insert into t values (14, 2, 3);
insert into t values (15, 2, 3);
insert into t values (16, 2, 3);
insert into t values (17, 2, 3);
insert into t values (18, 2, 3);
insert into t values (19, 2, 3);
insert into t values (20, 2, 3);
insert into t values (21, 2, 3);
insert into t values (22, 2, 3);
insert into t values (23, 2, 3);
insert into t values (24, 2, 3);
insert into t values (25, 2, 3);
insert into t values (26, 2, 3);
insert into t values (27, 2, 3);
insert into t values (28, 2, 3);
insert into t values (29, 2, 3);
insert into t values (30, 2, 3);
insert into t values (31, 2, 3);
insert into t values (32, 2, 3);
insert into t values (33, 2, 3);
insert into t values (34, 2, 3);
insert into t values (35, 2, 3);
insert into t values (36, 2, 3);
insert into t values (37, 2, 3);
insert into t values (38, 2, 3);
insert into t values (39, 2, 3);
insert into t values (40, 2, 3);
insert into t values (41, 2, 3);
insert into t values (42, 2, 3);
insert into t values (43, 2, 3);
insert into t values (44, 2, 3);
insert into t values (45, 2, 3);
insert into t values (46, 2, 3);
insert into t values (47, 2, 3);
insert into t values (48, 2, 3);
insert into t values (49, 2, 3);
insert into t values (50, 2, 3);
insert into t values (51, 2, 3);
insert into t values (52, 2, 3);
insert into t values (53, 2, 3);
insert into t values (54, 2, 3);
insert into t values (55, 2, 3);
insert into t values (56, 2, 3);
insert into t values (57, 2, 3);
insert into t values (58, 2, 3);
insert into t values (59, 2, 3);
insert into t values (60, 2, 3);
insert into t values (61, 2, 3);
insert into t values (62, 2, 3);
insert into t values (63, 2, 3);
insert into t values (64, 2, 3);
insert into t values (65, 2, 3);
insert into t values (66, 2, 3);
insert into t values (67, 2, 3);
insert into t values (68, 2, 3);
insert into t values (69, 2, 3);
insert into t values (70, 2, 3);
insert into t values (71, 2, 3);
insert into t values (72, 2, 3);
insert into t values (73, 2, 3);
insert into t values (74, 2, 3);
insert into t values (75, 2, 3);
insert into t values (76, 2, 3);
insert into t values (77, 2, 3);
insert into t values (78, 2, 3);
insert into t values (79, 2, 3);
insert into t values (80, 2, 3);
insert into t values (81, 2, 3);
insert into t values (82, 2, 3);
insert into t values (83, 2, 3);
insert into t values (84, 2, 3);
insert into t values (85, 2, 3);
insert into t values (86, 2, 3);
insert into t values (87, 2, 3);
insert into t values (88, 2, 3);
insert into t values (89, 2, 3);
insert into t values (90, 2, 3);
insert into t values (91, 2, 3);
insert into t values (92, 2, 3);
insert into t values (93, 2, 3);
insert into t values (94, 2, 3);
insert into t values (95, 2, 3);
insert into t values (96, 2, 3);
insert into t values (97, 2, 3);
insert into t values (98, 2, 3);
insert into t values (99, 2, 3);
insert into t values (100, 2, 3);
SELECT t1.y from t as t1, t as t2, t as t3, t as t4 where t1.y=t2.y
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment