snow888 发表于 2011-03-20 17:19

db2 求 sql 语句问题。

三张表 test1,test2

create table test1 ( a int not null,c decimal(18,2),d int not null,constraint pk_test1 primary key(a,d));


create table test2 ( a int not null,b char(6),constraint pk_test1 primary key(a));


select test1.a,test2.b,sum(test1.c) from test1,test2 where test1.a=test2.a group by test1.a,test2.b;


执行的结果居然返回的是 0 条记录;

why?
页: [1]
查看完整版本: db2 求 sql 语句问题。