~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/r/distinct.result

  • Committer: Jay Pipes
  • Date: 2009-02-21 16:00:06 UTC
  • mto: (907.1.1 trunk-with-temporal)
  • mto: This revision was merged to the branch mainline in revision 908.
  • Revision ID: jpipes@serialcoder-20090221160006-vnk3wt4qbcz62eru
Removes the TIME column type and related time functions.

Show diffs side-by-side

added added

removed removed

Lines of Context:
326
326
id
327
327
2
328
328
drop table t1,t2,t3;
329
 
create table t1 (a int not null, b int not null, t time);
330
 
insert into t1 values (1,1,"00:06:15"),(1,2,"00:06:15"),(1,2,"00:30:15"),(1,3,"00:06:15"),(1,3,"00:30:15");
331
 
select a,sec_to_time(sum(time_to_sec(t))) from t1 group by a,b;
332
 
a       sec_to_time(sum(time_to_sec(t)))
333
 
1       00:06:15
334
 
1       00:36:30
335
 
1       00:36:30
336
 
select distinct a,sec_to_time(sum(time_to_sec(t))) from t1 group by a,b;
337
 
a       sec_to_time(sum(time_to_sec(t)))
338
 
1       00:06:15
339
 
1       00:36:30
340
 
create table t2 (a int not null primary key, b int);
341
 
insert into t2 values (1,1),(2,2),(3,3);
342
 
select t1.a,sec_to_time(sum(time_to_sec(t))) from t1 left join t2 on (t1.b=t2.a) group by t1.a,t2.b;
343
 
a       sec_to_time(sum(time_to_sec(t)))
344
 
1       00:06:15
345
 
1       00:36:30
346
 
1       00:36:30
347
 
select distinct t1.a,sec_to_time(sum(time_to_sec(t))) from t1 left join t2 on (t1.b=t2.a) group by t1.a,t2.b;
348
 
a       sec_to_time(sum(time_to_sec(t)))
349
 
1       00:06:15
350
 
1       00:36:30
351
 
drop table t1,t2;
352
329
create table t1 (a int not null,b char(5), c text);
353
330
insert into t1 (a) values (1),(2),(3),(4),(1),(2),(3),(4);
354
331
select distinct a from t1 group by b,a having a > 2 order by a desc;