QUERY: create table foo (x int4, y int4, z int4); QUERY: create table bar (x int4, y int4, z int4); QUERY: create table baz (a int4, b int4); QUERY: insert into foo values (1, 2, 3); QUERY: insert into foo values (4, 5, 6); QUERY: insert into foo values (7, 8, 9); QUERY: insert into bar values (11, 12, 13); QUERY: insert into bar values (14, 15, 16); QUERY: insert into bar values (17, 18, 19); QUERY: insert into baz values (99, 88); QUERY: insert into baz values (77, 66); QUERY: select * from foo f where f.x = 4; x y z -- -- -- 4 5 6 QUERY: select * from foo f, foo where f.x > foo.x; x y z x y z -- -- -- -- -- -- 4 5 6 1 2 3 7 8 9 1 2 3 7 8 9 4 5 6 QUERY: select * from foo f, foo where f.x = 1 and foo.z > f.z; x y z x y z -- -- -- -- -- -- 1 2 3 4 5 6 1 2 3 7 8 9 QUERY: select y as a, z as b from foo order by a; a b -- -- 2 3 5 6 8 9 QUERY: select foo.y as a, foo.z as b from foo order by b; a b -- -- 2 3 5 6 8 9 QUERY: select foo.*, bar.z, baz.* from foo, bar, baz; x y z z a b -- -- -- --- --- --- 1 2 3 13 99 88 4 5 6 13 99 88 7 8 9 13 99 88 1 2 3 16 99 88 4 5 6 16 99 88 7 8 9 16 99 88 1 2 3 19 99 88 4 5 6 19 99 88 7 8 9 19 99 88 1 2 3 13 77 66 4 5 6 13 77 66 7 8 9 13 77 66 1 2 3 16 77 66 4 5 6 16 77 66 7 8 9 16 77 66 1 2 3 19 77 66 4 5 6 19 77 66 7 8 9 19 77 66 QUERY: drop table foo, bar, baz;