1 echo create table t1
(f1 char
(10),f2 char
(10),f3 int
);
3 Statement Executed
: Rows Affected
= 1
4 Statement Executed
: Rows Affected
= 1
5 Statement Executed
: Rows Affected
= 1
6 Statement Executed
: Rows Affected
= 1
7 Statement Executed
: Rows Affected
= 1
8 Statement Executed
: Rows Affected
= 1
9 Statement Executed
: Rows Affected
= 1
10 Statement Executed
: Rows Affected
= 1
11 Statement Executed
: Rows Affected
= 1
12 Statement Executed
: Rows Affected
= 1
13 Statement Executed
: Rows Affected
= 1
14 Statement Executed
: Rows Affected
= 1
15 echo select * from t1
;
16 ---------------------------------------------------------
18 ---------------------------------------------------------
32 echo select f2
,avg
(f3
) from t1 group by f2
;
33 ---------------------------------------------------------
35 ---------------------------------------------------------
41 echo select f2
,avg
(f3
) from t1 where f3
>=3000 group by f2
;
42 ---------------------------------------------------------
44 ---------------------------------------------------------
49 echo select f2
,avg
(f3
) from t1 where f3
>=2000 group by f2 having avg
(f3
)>3000;
50 ---------------------------------------------------------
52 ---------------------------------------------------------
56 echo select f2
,avg
(f3
) from t1 where f3
>=2000 group by f2 having avg
(f3
)>3000 limit
1;
57 ---------------------------------------------------------
59 ---------------------------------------------------------
62 echo select f2
,avg
(f3
) from t1 where f3
>=2000 or f2
= 'y' group by f2 having avg
(f3
)>3000;
63 ---------------------------------------------------------
65 ---------------------------------------------------------
69 echo select f1
,f2
,avg
(f3
) from t1 where f3
>=2000 or f2
= 'y' group by f1
,f2 having avg
(f3
)>3000 ;
70 ---------------------------------------------------------
72 ---------------------------------------------------------
79 echo select f2
,f1
,avg
(f3
) from t1 where f3
>=2000 or f2
= 'y' group by f1
,f2 having avg
(f3
)>3000;
80 ---------------------------------------------------------
82 ---------------------------------------------------------
89 echo select f2
,f1
,avg
(f3
) from t1 where f3
>=2000 or f2
= 'y' group by f1
,f2 having avg
(f3
)>2000 ;
90 ---------------------------------------------------------
92 ---------------------------------------------------------
102 echo select f2
,f1
,avg
(f3
) from t1 where f3
>=2000 or f2
= 'y' group by f1
,f2 having avg
(f3
)>2000 limit
3 offset
2;
103 ---------------------------------------------------------
105 ---------------------------------------------------------