join.sql.out
上传用户:blenddy
上传日期:2007-01-07
资源大小:6495k
文件大小:1k
- QUERY: create table foo (x int4, y int4);
- QUERY: create table bar (p int4, q int4);
- QUERY: create table baz (a int4, b int4);
- QUERY: insert into foo values (1, 1);
- QUERY: insert into foo values (2, 2);
- QUERY: insert into bar values (1, 1);
- QUERY: insert into baz values (1, 1);
- QUERY: insert into baz values (2, 2);
- QUERY: select * from foo,bar,baz
- where foo.x=bar.p and bar.p=baz.a and baz.b=foo.y;
- x y p q a b
- -- -- -- -- -- --
- 1 1 1 1 1 1
- QUERY: select * from foo,bar,baz
- where foo.y=bar.p and bar.p=baz.a and baz.b=foo.x and foo.y=bar.q;
- x y p q a b
- -- -- -- -- -- --
- 1 1 1 1 1 1
- QUERY: select * from foo,bar,baz
- where foo.x=bar.q and bar.p=baz.b and baz.b=foo.y and foo.y=bar.q
- and bar.p=baz.a;
- x y p q a b
- -- -- -- -- -- --
- 1 1 1 1 1 1
- QUERY: select * from foo,bar,baz
- where foo.y=bar.p and bar.q=baz.b and baz.b=foo.x and foo.x=bar.q
- and bar.p=baz.a and bar.p=baz.a;
- x y p q a b
- -- -- -- -- -- --
- 1 1 1 1 1 1
- QUERY: select bar.p from foo, bar;
- p
- --
- 1
- 1
- QUERY: select foo.x from foo, bar where foo.x = bar.p;
- x
- --
- 1
- QUERY: drop table foo, bar, baz;