⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 rules.out

📁 关系型数据库 Postgresql 6.5.2
💻 OUT
📖 第 1 页 / 共 4 页
字号:
(1 row)QUERY: select * from rtest_t7; a|b                                  --+-----------------------------------19|Record should go to rtest_t5 and t7(1 row)QUERY: select * from rtest_t8; a|b                                  --+-----------------------------------26|Record should go to rtest_t4 and t828|Record should go to rtest_t4 and t8(2 rows)QUERY: insert into rtest_order1 values (1);QUERY: select * from rtest_order2;a|b|c                                  -+-+-----------------------------------1|1|rule 2 - this should run 1st       1|2|rule 4 - this should run 2nd       1|3|rule 3 - this should run 3rd or 4th1|4|rule 1 - this should run 3rd or 4th(4 rows)QUERY: insert into rtest_nothn1 values (1, 'want this');QUERY: insert into rtest_nothn1 values (2, 'want this');QUERY: insert into rtest_nothn1 values (10, 'don''t want this');QUERY: insert into rtest_nothn1 values (19, 'don''t want this');QUERY: insert into rtest_nothn1 values (20, 'want this');QUERY: insert into rtest_nothn1 values (29, 'want this');QUERY: insert into rtest_nothn1 values (30, 'don''t want this');QUERY: insert into rtest_nothn1 values (39, 'don''t want this');QUERY: insert into rtest_nothn1 values (40, 'want this');QUERY: insert into rtest_nothn1 values (50, 'want this');QUERY: insert into rtest_nothn1 values (60, 'want this');QUERY: select * from rtest_nothn1; a|b        --+--------- 1|want this 2|want this20|want this29|want this40|want this50|want this60|want this(7 rows)QUERY: insert into rtest_nothn2 values (10, 'too small');QUERY: insert into rtest_nothn2 values (50, 'too small');QUERY: insert into rtest_nothn2 values (100, 'OK');QUERY: insert into rtest_nothn2 values (200, 'OK');QUERY: select * from rtest_nothn2;a|b-+-(0 rows)QUERY: select * from rtest_nothn3;  a|b ---+--100|OK200|OK(2 rows)QUERY: delete from rtest_nothn1;QUERY: delete from rtest_nothn2;QUERY: delete from rtest_nothn3;QUERY: insert into rtest_nothn4 values (1, 'want this');QUERY: insert into rtest_nothn4 values (2, 'want this');QUERY: insert into rtest_nothn4 values (10, 'don''t want this');QUERY: insert into rtest_nothn4 values (19, 'don''t want this');QUERY: insert into rtest_nothn4 values (20, 'want this');QUERY: insert into rtest_nothn4 values (29, 'want this');QUERY: insert into rtest_nothn4 values (30, 'don''t want this');QUERY: insert into rtest_nothn4 values (39, 'don''t want this');QUERY: insert into rtest_nothn4 values (40, 'want this');QUERY: insert into rtest_nothn4 values (50, 'want this');QUERY: insert into rtest_nothn4 values (60, 'want this');QUERY: insert into rtest_nothn1 select * from rtest_nothn4;QUERY: select * from rtest_nothn1; a|b        --+--------- 1|want this 2|want this20|want this29|want this40|want this50|want this60|want this(7 rows)QUERY: delete from rtest_nothn4;QUERY: insert into rtest_nothn4 values (10, 'too small');QUERY: insert into rtest_nothn4 values (50, 'too small');QUERY: insert into rtest_nothn4 values (100, 'OK');QUERY: insert into rtest_nothn4 values (200, 'OK');QUERY: insert into rtest_nothn2 select * from rtest_nothn4;QUERY: select * from rtest_nothn2;a|b-+-(0 rows)QUERY: select * from rtest_nothn3;  a|b ---+--100|OK200|OK(2 rows)QUERY: create table rtest_view1 (a int4, b text, v bool);QUERY: create table rtest_view2 (a int4);QUERY: create table rtest_view3 (a int4, b text);QUERY: create table rtest_view4 (a int4, b text, c int4);QUERY: create view rtest_vview1 as select a, b from rtest_view1 X	where 0 < (select count(*) from rtest_view2 Y where Y.a = X.a);QUERY: create view rtest_vview2 as select a, b from rtest_view1 where v;QUERY: create view rtest_vview3 as select a, b from rtest_vview2 X	where 0 < (select count(*) from rtest_view2 Y where Y.a = X.a);QUERY: create view rtest_vview4 as select X.a, X.b, count(Y.a) as refcount	from rtest_view1 X, rtest_view2 Y	where X.a = Y.a	group by X.a, X.b;QUERY: create function rtest_viewfunc1(int4) returns int4 as	'select count(*) from rtest_view2 where a = $1'	language 'sql';QUERY: create view rtest_vview5 as select a, b, rtest_viewfunc1(a) as refcount	from rtest_view1;QUERY: insert into rtest_view1 values (1, 'item 1', 't');QUERY: insert into rtest_view1 values (2, 'item 2', 't');QUERY: insert into rtest_view1 values (3, 'item 3', 't');QUERY: insert into rtest_view1 values (4, 'item 4', 'f');QUERY: insert into rtest_view1 values (5, 'item 5', 't');QUERY: insert into rtest_view1 values (6, 'item 6', 'f');QUERY: insert into rtest_view1 values (7, 'item 7', 't');QUERY: insert into rtest_view1 values (8, 'item 8', 't');QUERY: insert into rtest_view2 values (2);QUERY: insert into rtest_view2 values (2);QUERY: insert into rtest_view2 values (4);QUERY: insert into rtest_view2 values (5);QUERY: insert into rtest_view2 values (7);QUERY: insert into rtest_view2 values (7);QUERY: insert into rtest_view2 values (7);QUERY: insert into rtest_view2 values (7);QUERY: select * from rtest_vview1;a|b     -+------2|item 24|item 45|item 57|item 7(4 rows)QUERY: select * from rtest_vview2;a|b     -+------1|item 12|item 23|item 35|item 57|item 78|item 8(6 rows)QUERY: select * from rtest_vview3;a|b     -+------2|item 25|item 57|item 7(3 rows)QUERY: select * from rtest_vview4;a|b     |refcount-+------+--------2|item 2|       24|item 4|       15|item 5|       17|item 7|       4(4 rows)QUERY: select * from rtest_vview5;a|b     |refcount-+------+--------1|item 1|       02|item 2|       23|item 3|       04|item 4|       15|item 5|       16|item 6|       07|item 7|       48|item 8|       0(8 rows)QUERY: insert into rtest_view3 select * from rtest_vview1 where a < 7;QUERY: select * from rtest_view3;a|b     -+------2|item 24|item 45|item 5(3 rows)QUERY: delete from rtest_view3;QUERY: insert into rtest_view3 select * from rtest_vview2 where a != 5 and b !~ '2';QUERY: select * from rtest_view3;a|b     -+------1|item 13|item 37|item 78|item 8(4 rows)QUERY: delete from rtest_view3;QUERY: insert into rtest_view3 select * from rtest_vview3;QUERY: select * from rtest_view3;a|b     -+------2|item 25|item 57|item 7(3 rows)QUERY: delete from rtest_view3;QUERY: insert into rtest_view4 select * from rtest_vview4 where 3 > refcount;QUERY: select * from rtest_view4;a|b     |c-+------+-2|item 2|24|item 4|15|item 5|1(3 rows)QUERY: delete from rtest_view4;QUERY: insert into rtest_view4 select * from rtest_vview5 where a > 2 and refcount = 0;QUERY: select * from rtest_view4;a|b     |c-+------+-3|item 3|06|item 6|08|item 8|0(3 rows)QUERY: delete from rtest_view4;QUERY: create table rtest_comp (	part	text,	unit	char(4),	size	float);QUERY: create table rtest_unitfact (	unit	char(4),	factor	float);QUERY: create view rtest_vcomp as	select X.part, (X.size * Y.factor) as size_in_cm			from rtest_comp X, rtest_unitfact Y			where X.unit = Y.unit;QUERY: insert into rtest_unitfact values ('m', 100.0);QUERY: insert into rtest_unitfact values ('cm', 1.0);QUERY: insert into rtest_unitfact values ('inch', 2.54);QUERY: insert into rtest_comp values ('p1', 'm', 5.0);QUERY: insert into rtest_comp values ('p2', 'm', 3.0);QUERY: insert into rtest_comp values ('p3', 'cm', 5.0);QUERY: insert into rtest_comp values ('p4', 'cm', 15.0);QUERY: insert into rtest_comp values ('p5', 'inch', 7.0);QUERY: insert into rtest_comp values ('p6', 'inch', 4.4);QUERY: select * from rtest_vcomp order by part;part|size_in_cm----+----------p1  |       500p2  |       300p3  |         5p4  |        15p5  |     17.78p6  |    11.176(6 rows)QUERY: select * from rtest_vcomp where size_in_cm > 10.0 order by size_in_cm using >;part|size_in_cm----+----------p1  |       500p2  |       300

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -