~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/r/having.result

  • Committer: Brian Aker
  • Date: 2010-01-27 18:58:12 UTC
  • Revision ID: brian@gaz-20100127185812-n62n0vwetnx8jrjy
Remove dead code.

Show diffs side-by-side

added added

removed removed

Lines of Context:
10
10
0
11
11
explain extended select count(a) as b from t1 where a=0 having b >=0;
12
12
id      select_type     table   type    possible_keys   key     key_len ref     rows    filtered        Extra
13
 
1       SIMPLE  NULL    NULL    NULL    NULL    NULL    NULL    NULL    NULL    Impossible WHERE noticed after reading const tables
 
13
1       SIMPLE  t1      ALL     NULL    NULL    NULL    NULL    1       100.00  Using where
14
14
Warnings:
15
 
Note    1003    select count('0') AS "b" from "test"."t1" where 0 having ("b" >= 0)
 
15
Note    1003    select count(`test`.`t1`.`a`) AS `b` from `test`.`t1` where (`test`.`t1`.`a` = 0) having (`b` >= 0)
16
16
drop table t1;
17
17
CREATE TABLE t1 (
18
 
raw_id int(10) NOT NULL default '0',
19
 
chr_start int(10) NOT NULL default '0',
20
 
chr_end int(10) NOT NULL default '0',
21
 
raw_start int(10) NOT NULL default '0',
22
 
raw_end int(10) NOT NULL default '0',
23
 
raw_ori int(2) NOT NULL default '0'
 
18
raw_id int NOT NULL default '0',
 
19
chr_start int NOT NULL default '0',
 
20
chr_end int NOT NULL default '0',
 
21
raw_start int NOT NULL default '0',
 
22
raw_end int NOT NULL default '0',
 
23
raw_ori int NOT NULL default '0'
24
24
);
25
25
INSERT INTO t1 VALUES (469713,1,164123,1,164123,1),(317330,164124,317193,101,153170,1),(469434,317194,375620,101,58527,1),(591816,375621,484273,1,108653,1),(591807,484274,534671,91,50488,1),(318885,534672,649362,101,114791,1),(318728,649363,775520,102,126259,1),(336829,775521,813997,101,38577,1),(317740,813998,953227,101,139330,1),(1,813998,953227,101,139330,1);
26
26
CREATE TABLE t2 (
27
 
id int(10) unsigned NOT NULL default '0',
28
 
contig_id int(10) unsigned NOT NULL default '0',
29
 
seq_start int(10) NOT NULL default '0',
30
 
seq_end int(10) NOT NULL default '0',
31
 
strand tinyint(2) NOT NULL default '0',
 
27
id int NOT NULL default '0',
 
28
contig_id int NOT NULL default '0',
 
29
seq_start int NOT NULL default '0',
 
30
seq_end int NOT NULL default '0',
 
31
strand int NOT NULL default '0',
32
32
KEY id (id)
33
33
);
34
34
INSERT INTO t2 VALUES (133195,469713,61327,61384,1),(133196,469713,64113,64387,1),(133197,1,1,1,0),(133197,1,1,1,-2);
49
49
id      start   end     chr_strand
50
50
133197  813898  813898  -1.0000
51
51
drop table t1,t2;
52
 
CREATE TABLE t1 (Fld1 int(11) default NULL,Fld2 int(11) default NULL);
 
52
CREATE TABLE t1 (Fld1 int default NULL,Fld2 int default NULL);
53
53
INSERT INTO t1 VALUES (1,10),(1,20),(2,NULL),(2,NULL),(3,50);
54
54
select Fld1, max(Fld2) as q from t1 group by Fld1 having q is not null;
55
55
Fld1    q
87
87
5
88
88
9
89
89
drop table t1;
90
 
CREATE TABLE t1 (
91
 
`id` bigint(20) NOT NULL default '0',
 
90
CREATE TEMPORARY TABLE t1 (
 
91
`id` bigint NOT NULL default '0',
92
92
`description` text
93
93
) ENGINE=MyISAM;
94
 
CREATE TABLE t2 (
95
 
`id` bigint(20) NOT NULL default '0',
 
94
CREATE TEMPORARY TABLE t2 (
 
95
`id` bigint NOT NULL default '0',
96
96
`description` varchar(20)
97
97
) ENGINE=MyISAM;
98
98
INSERT INTO t1  VALUES (1, 'test');
99
99
INSERT INTO t2 VALUES (1, 'test');
100
 
CREATE TABLE t3 (
101
 
`id`       bigint(20) NOT NULL default '0',
102
 
`order_id` bigint(20) NOT NULL default '0'
 
100
CREATE TEMPORARY TABLE t3 (
 
101
`id`       bigint NOT NULL default '0',
 
102
`order_id` bigint NOT NULL default '0'
103
103
) ENGINE=MyISAM;
104
104
select
105
105
a.id, a.description,
237
237
20      hello
238
238
30      hello
239
239
select sum(col1) as co12 from t1 group by col2 having col2 10;
240
 
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '10' at line 1
 
240
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your Drizzle server version for the right syntax to use near '10' at line 1
241
241
select sum(col1) as co2, count(col2) as cc from t1 group by col1 having col1 =10;
242
242
co2     cc
243
243
40      4
369
369
select * from t1 a, t1 b group by a.s1 having s1 is null;
370
370
ERROR 23000: Column 's1' in having clause is ambiguous
371
371
drop table t1;
372
 
create table t1 (s1 char character set latin1 collate latin1_german1_ci);
 
372
create table t1 (s1 char);
373
373
insert into t1 values ('b'),('y');
374
 
select s1,count(s1) from t1
375
 
group by s1 collate latin1_swedish_ci having s1 = 'y';
 
374
select s1,count(s1) from t1 group by s1 having s1 = 'y';
376
375
s1      count(s1)
377
376
y       1
378
377
drop table t1;