~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/r/func_group.result

  • Committer: Monty Taylor
  • Date: 2011-02-13 17:26:39 UTC
  • mfrom: (2157.2.2 give-in-to-pkg-config)
  • mto: This revision was merged to the branch mainline in revision 2166.
  • Revision ID: mordred@inaugust.com-20110213172639-nhy7i72sfhoq13ms
Merged in pkg-config fixes.

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;
 
179
select max(t1.a1) from t1, t2 where t1.a1 > 0;
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;
 
193
select t1.a1, t1.a2, t2.a1, t2.a2 from t1,t2 where t1.a1 > 0;
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      range   PRIMARY PRIMARY 0       NULL    7       Using where; Using index
 
532
1       SIMPLE  t1      index   PRIMARY PRIMARY 14      NULL    15      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      index   k2      PRIMARY 14      NULL    7       Using where
 
581
1       SIMPLE  t2      range   k2      k2      15      NULL    6       Using where; Using index
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
870
871
0.50000 6
 
872
0.66667 6
871
873
1.00000 18
872
874
1.50000 6
873
875
2.00000 6
874
876
3.00000 6
875
 
9999999999.99999        12
876
877
SELECT SUM(a) FROM t1 GROUP BY b/c;
877
878
SUM(a)
878
879
6
 
880
6
 
881
6
879
882
18
880
883
6
881
884
6
882
885
6
883
 
12
884
886
DROP TABLE t1;
885
887
set div_precision_increment= @sav_dpi;
886
888
CREATE TABLE t1 (a INT PRIMARY KEY, b INT);
1221
1223
INSERT INTO t2 ( a, b, c ) VALUES ( 1, NULL, 2 ), ( 1, 3, 4 ), ( 1, 4, 4 );
1222
1224
EXPLAIN SELECT MIN(b), MIN(c) FROM t2 WHERE a = 1;
1223
1225
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
1224
 
1       SIMPLE  t2      ref     a       a       5       const   1       Using where
 
1226
1       SIMPLE  t2      ALL     a       NULL    NULL    NULL    3       Using where
1225
1227
SELECT MIN(b), MIN(c) FROM t2 WHERE a = 1;
1226
1228
MIN(b)  MIN(c)
1227
1229
3       2