0
我需要一些幫助來制定select語句。我需要選擇以不同顏色爲每個部件發貨的總量。所以結果應該與顏色名稱和總數一致。將多個聚合函數作爲行返回
這裏是我的架構:
create table s
(sno char(5) not null,
sname char(20) not null,
status smallint,
city char(15),
primary key (sno)
);
create table p
(pno char(6) not null,
pname char(20) not null,
color char(6),
weight smallint,
city char(15),
primary key (pno)
);
create table sp
(sno char(5) not null,
pno char(6) not null,
qty integer not null,
primary key (sno, pno)
);
此外,我不認爲UNIONs是允許的這個例子 – SDLFunTimes 2010-04-22 06:51:09