~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/r/func_group.result

  • Committer: patrick crews
  • Date: 2010-09-29 15:15:19 UTC
  • mfrom: (1099.4.188 drizzle)
  • Revision ID: gleebix@gmail.com-20100929151519-6mrmzd1ciw2p9nws
Tags: 2010.09.1802
Update translations

Show diffs side-by-side

added added

removed removed

Lines of Context:
176
176
select max(t1.a1), max(t2.a2) from t1, t2;
177
177
max(t1.a1)      max(t2.a2)
178
178
NULL    NULL
179
 
select max(t1.a1) from t1, t2 where t1.a1 > 0;
 
179
select max(t1.a1) from t1, t2;
180
180
max(t1.a1)
181
181
NULL
182
182
select max(t2.a2), max(t1.a1) from t1, t2;
190
190
1       SIMPLE  NULL    NULL    NULL    NULL    NULL    NULL    NULL    No matching min/max row
191
191
insert into t2 values('AAA', 10, 0.5);
192
192
insert into t2 values('BBB', 20, 1.0);
193
 
select t1.a1, t1.a2, t2.a1, t2.a2 from t1,t2 where t1.a1 > 0;
 
193
select t1.a1, t1.a2, t2.a1, t2.a2 from t1,t2;
194
194
a1      a2      a1      a2
195
195
10      NULL    AAA     10
196
196
10      NULL    BBB     20
529
529
explain 
530
530
select min(a1) from t1 where a1 > 'KKK' or a1 < 'XXX';
531
531
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
532
 
1       SIMPLE  t1      index   PRIMARY PRIMARY 14      NULL    15      Using where; Using index
 
532
1       SIMPLE  t1      range   PRIMARY PRIMARY 0       NULL    7       Using where; Using index
533
533
explain 
534
534
select min(a1) from t1 where a1 != 'KKK';
535
535
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
578
578
explain
579
579
select concat(min(t1.a1),min(t2.a4)) from t1, t2 where t2.a4 <> 'AME';
580
580
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
581
 
1       SIMPLE  t2      range   k2      k2      15      NULL    6       Using where; Using index
 
581
1       SIMPLE  t2      index   k2      PRIMARY 14      NULL    7       Using where
582
582
1       SIMPLE  t1      index   NULL    PRIMARY 14      NULL    15      Using index; Using join buffer
583
583
drop table t1, t2;
584
584
create table t1 (a char);
867
867
3.00000 3
868
868
SELECT b/c as v, SUM(a) FROM t1 GROUP BY v;
869
869
v       SUM(a)
870
 
0.33333 6
871
870
0.50000 6
872
 
0.66667 6
873
871
1.00000 18
874
872
1.50000 6
875
873
2.00000 6
876
874
3.00000 6
 
875
9999999999.99999        12
877
876
SELECT SUM(a) FROM t1 GROUP BY b/c;
878
877
SUM(a)
879
878
6
880
 
6
881
 
6
882
879
18
883
880
6
884
881
6
885
882
6
 
883
12
886
884
DROP TABLE t1;
887
885
set div_precision_increment= @sav_dpi;
888
886
CREATE TABLE t1 (a INT PRIMARY KEY, b INT);
1223
1221
INSERT INTO t2 ( a, b, c ) VALUES ( 1, NULL, 2 ), ( 1, 3, 4 ), ( 1, 4, 4 );
1224
1222
EXPLAIN SELECT MIN(b), MIN(c) FROM t2 WHERE a = 1;
1225
1223
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
1226
 
1       SIMPLE  t2      ALL     a       NULL    NULL    NULL    3       Using where
 
1224
1       SIMPLE  t2      ref     a       a       5       const   1       Using where
1227
1225
SELECT MIN(b), MIN(c) FROM t2 WHERE a = 1;
1228
1226
MIN(b)  MIN(c)
1229
1227
3       2