windows changes
[csql.git] / test / tools / csql / aggregate6.sql
blob9a7f82f9f9e3ccdc1ffa61ab9f9dde71f360be3b
1 create table t1 (f1 smallint, f2 bigint, primary key (f1));
2 insert into t1 values (10, 200);
3 insert into t1 values (11, 210);
4 insert into t1 values (20, 500);
5 insert into t1 values (13, 230);
6 insert into t1 values (14, 240);
7 insert into t1 values (50, 500);
8 insert into t1 values (5, 500);
9 insert into t1 values (12, 240);
10 insert into t1 values (11, 210);
12 echo select * from t1;
13 select * from t1;
14 echo select count(*) from t1;
15 select count(*) from t1;
16 echo select count(f1) from t1;
17 select count(f1) from t1;
18 echo select count(f2) from t1;
19 select count(f2) from t1;
21 echo select * from t1 where f1 =11;
22 select * from t1 where f1 =11;
23 echo select count(*) from t1 where f1 = 11;
24 select count(*) from t1 where f1 = 11;
25 echo select count(f1) from t1 where f1=20;
26 select count(f1) from t1 where f1=20;
27 echo select count(f2) from t1 where f2=500;
28 select count(f2) from t1 where f2=500;
30 echo select * from t1;
31 select * from t1;
32 echo select min(f1) from t1;
33 select min(f1) from t1;
34 echo select min(f2) from t1;
35 select min(f2) from t1;
37 echo select min(f1) from t1 where f1=20;
38 select min(f1) from t1 where f1=20;
39 echo select min(f2) from t1 where f2=500;
40 select min(f2) from t1 where f2=500;
42 echo select * from t1;
43 select * from t1;
44 echo select max(f1) from t1;
45 select max(f1) from t1;
46 echo select max(f2) from t1;
47 select max(f2) from t1;
49 echo select max(f1) from t1 where f1=20;
50 select max(f1) from t1 where f1=20;
51 echo select max(f2) from t1 where f2=500;
52 select max(f2) from t1 where f2=500;
54 echo select * from t1;
55 select * from t1;
56 echo select avg(f1) from t1;
57 select avg(f1) from t1;
58 echo select avg(f2) from t1;
59 select avg(f2) from t1;
61 echo select avg(f1) from t1 where f1=20;
62 select avg(f1) from t1 where f1=20;
63 echo select avg(f2) from t1 where f2=500;
64 select avg(f2) from t1 where f2=500;
66 echo select * from t1;
67 select * from t1;
68 echo select sum(f1) from t1;
69 select sum(f1) from t1;
70 echo select sum(f2) from t1;
71 select sum(f2) from t1;
73 echo select sum(f1) from t1 where f1=20;
74 select sum(f1) from t1 where f1=20;
75 echo select sum(f2) from t1 where f2=500;
76 select sum(f2) from t1 where f2=500;
77 echo drop table t1;
78 drop table t1;