|
sql db
INGRES TERMINAL MONITOR Copyright 2012 Ingres Corporation
Vectorwise Linux Version VW 2.5.2 (a64.lnx/175)NPTL login
Thu Jun 5 21:57:24 2014
Enter \g to execute commands, "help help\g" for help, \q to quit
continue
* create table t as select 1 a union select 2;
* \g
Executing . . .
(2 rows)
continue
* create table t1w as
* select rn from(
* select row_number()over(order by a.a) rn from
* (select t.a from t,t t1,t t2,t t3,t t4,t t5,t t6,t t7,t t8,t t9)a,
* (select t.a from t,t t1,t t2,t t3)b
* )c where rn<=10000;
* \g
Executing . . .
(10000 rows)
continue
* create table t5k as select rn from t1w where rn<=5000;
* \g
Executing . . .
(5000 rows)
continue
* with a as(select (s.rn-1)*10000+t.rn a from t1w t,t5k s)
* select substr(a,-1,1)x,sum(a)s from a
* group by substr(a,-1,1)
* order by 1;
* \rt \g
Executing . . .
+----------------------+----------------------+
|x |s |
+----------------------+----------------------+
|0 | 125000025000000|
|1 | 124999980000000|
|2 | 124999985000000|
|3 | 124999990000000|
|4 | 124999995000000|
|5 | 125000000000000|
|6 | 125000005000000|
|7 | 125000010000000|
|8 | 125000015000000|
|9 | 125000020000000|
+----------------------+----------------------+
(10 rows in 1.534120 secs)
continue
* |
|