1樓:
select aa01 , sum(cc02) from aa01inner join bb01
on aa01=bb01
iner join cco1
on bb02=cc02
group by aa01
大概語句就是這樣,bb01和cc01是通過bb02和cc02關聯
2樓:匿名使用者
select a.aa01,a.aa02,a.aa03,b.bb02, c.cc03
from aa01 a
inner join bb01 b on a.aa01 = b.bb01
inner join cc01 c on a.aa02 = c.cc01 and b.bb02 = c.cc02
group by a.aa01
3樓:斯內科
select a.aa01,sum(c.cc02) fromaa01 a,bb01 b,cc01 c
where a.aa01=b.bb01 and c.cc01=b.bb02
group by a.aa01
--試試,你的要求感覺表達的不夠清晰
sql查詢問題
select name,sum case ym when 201001 then amount else 0 end as 一月,sum case ym when 201002 then amount else 0 end as 二月,sum case ym when 201003 then amo...
sql連線查詢語句問題,SQL連線查詢語句問題!!!
簡單寫的話,sql語句就是 select top 10 title date from select title date from new union select title date from res union select title date from affiche as tbltit...
sql查詢語句問題
select from 銷售合計 where 出貨單位 like 第一醫院 and 品名 like 蘇靈 or 品名 like 尼莫地平片 也沒啥別的毛病。覺得你這裡沒有必要模糊查詢啊。你不是知道要的是什麼資料嗎,可以將like改成 select from 銷售合計 where 出貨單位 like ...