~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/r/subselect3.result

  • Committer: Brian Aker
  • Date: 2008-09-04 19:31:00 UTC
  • Revision ID: brian@tangent.org-20080904193100-l849hgghfy4urj43
Changing default character set from this point on.

Show diffs side-by-side

added added

removed removed

Lines of Context:
432
432
explain select oref, a, a in (select ie from t1 where oref=t2.oref) Z from t2;
433
433
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
434
434
1       PRIMARY t2      ALL     NULL    NULL    NULL    NULL    7       
435
 
2       DEPENDENT SUBQUERY      t1      ref_or_null     idx     idx     24      test.t2.oref,func       10      Using where; Using index; Full scan on NULL key
 
435
2       DEPENDENT SUBQUERY      t1      ref_or_null     idx     idx     12      test.t2.oref,func       10      Using where; Using index; Full scan on NULL key
436
436
select oref, a, a in (select ie from t1 where oref=t2.oref) Z from t2;
437
437
oref    a       Z
438
438
ee      NULL    NULL
444
444
bb      NULL    NULL
445
445
select oref, a from t2 where a in (select ie from t1 where oref=t2.oref);
446
446
oref    a
 
447
ff      2
447
448
aa      1
448
 
ff      2
449
449
select oref, a from t2 where a not in (select ie from t1 where oref=t2.oref);
450
450
oref    a
451
451
bb      2
457
457
from t2;
458
458
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
459
459
1       PRIMARY t2      ALL     NULL    NULL    NULL    NULL    7       
460
 
2       DEPENDENT SUBQUERY      t1      ref     idx     idx     19      test.t2.oref    5       Using where; Using temporary; Using filesort
 
460
2       DEPENDENT SUBQUERY      t1      ref     idx     idx     7       test.t2.oref    5       Using where; Using temporary; Using filesort
461
461
select oref, a, 
462
462
a in (select min(ie) from t1 where oref=t2.oref 
463
463
group by grp having min(ie) > 1) Z 
744
744
DROP TABLE t1,t2,t3;
745
745
CREATE TABLE t1 (a INT NOT NULL);
746
746
INSERT INTO t1 VALUES (1),(-1), (65),(66);
747
 
CREATE TABLE t2 (a INT NOT NULL PRIMARY KEY);
 
747
CREATE TABLE t2 (a INT UNSIGNED NOT NULL PRIMARY KEY);
748
748
INSERT INTO t2 VALUES (65),(66);
749
749
SELECT a FROM t1 WHERE a NOT IN (65,66);
750
750
a
757
757
EXPLAIN SELECT a FROM t1 WHERE a NOT IN (SELECT a FROM t2);
758
758
id      select_type     table   type    possible_keys   key     key_len ref     rows    Extra
759
759
1       PRIMARY t1      ALL     NULL    NULL    NULL    NULL    4       Using where
760
 
2       DEPENDENT SUBQUERY      t2      unique_subquery PRIMARY PRIMARY 4       func    1       Using index
 
760
2       DEPENDENT SUBQUERY      t2      unique_subquery PRIMARY PRIMARY 4       func    1       Using index; Using where
761
761
DROP TABLE t1, t2;
762
762
CREATE TABLE t1 (a INT);
763
763
INSERT INTO t1 VALUES(1);