~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/r/distinct.result

  • Committer: Brian Aker
  • Date: 2010-08-17 01:34:55 UTC
  • mto: (1711.1.23 build)
  • mto: This revision was merged to the branch mainline in revision 1714.
  • Revision ID: brian@tangent.org-20100817013455-zx3nm7qilxvpwrgb
Style on structure cleanup

Show diffs side-by-side

added added

removed removed

Lines of Context:
175
175
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
176
176
1       SIMPLE  t1      ALL     PRIMARY NULL    NULL    NULL    4       Using temporary
177
177
1       SIMPLE  t2      ref     a       a       4       test.t1.a       1       Using index
178
 
1       SIMPLE  t3      ref     a       a       5       test.t1.b       1       Using where; Using index
 
178
1       SIMPLE  t3      ref     a       a       5       test.t1.b       1       Using index
179
179
SELECT distinct t3.a FROM t3,t2,t1 WHERE t3.a=t1.b AND t1.a=t2.a;
180
180
a
181
181
1
190
190
explain select distinct t1.a from t1,t3 where t1.a=t3.a;
191
191
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
192
192
1       SIMPLE  t1      index   PRIMARY PRIMARY 4       NULL    4       Using index; Using temporary
193
 
1       SIMPLE  t3      ref     a       a       5       test.t1.a       1       Using where; Using index; Distinct
 
193
1       SIMPLE  t3      ref     a       a       5       test.t1.a       1       Using index; Distinct
194
194
select distinct t1.a from t1,t3 where t1.a=t3.a;
195
195
a
196
196
1
397
397
SELECT DISTINCTROW email, shipcode FROM t1, t2 WHERE t1.infoID=t2.infoID;
398
398
email   shipcode
399
399
test1@testdomain.com    Z001
 
400
test2@testdomain.com    Z001
400
401
test2@testdomain.com    R002
401
 
test2@testdomain.com    Z001
402
402
test3@testdomain.com    Z001
403
403
SELECT DISTINCTROW email FROM t1 ORDER BY dateentered DESC;
404
404
email
523
523
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
524
524
1       SIMPLE  t1      ALL     NULL    NULL    NULL    NULL    3       
525
525
EXPLAIN SELECT DISTINCT t1_1.a, t1_1.b FROM t1 t1_1, t1 t1_2;
526
 
ERROR HY000: Implicit cartesian join attempted.
 
526
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
 
527
1       SIMPLE  t1_1    ALL     NULL    NULL    NULL    NULL    3       Using temporary
 
528
1       SIMPLE  t1_2    index   NULL    PRIMARY 4       NULL    3       Using index; Distinct; Using join buffer
527
529
EXPLAIN SELECT DISTINCT t1_1.a, t1_1.b FROM t1 t1_1, t1 t1_2
528
530
WHERE t1_1.a = t1_2.a;
529
531
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
 
532
1       SIMPLE  t1_2    index   PRIMARY PRIMARY 4       NULL    3       Using index; Using temporary
530
533
1       SIMPLE  t1_1    ALL     PRIMARY NULL    NULL    NULL    3       Using where; Using join buffer
531
 
1       SIMPLE  t1_2    index   PRIMARY PRIMARY 4       NULL    3       Using index; Using temporary
532
534
EXPLAIN SELECT a FROM t1 GROUP BY a;
533
535
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
534
536
1       SIMPLE  t1      index   NULL    PRIMARY 4       NULL    3       Using index