今天笔试中的SQL题
答案 :
select a.[year],a.amount as m1,b.amount as m2,c.amount as m3,d.amount as m4
from table1 as a,table1 as b,table1 as c,table1 as d where
a.[month]=b.[month] and b.[month]=c.[month] and c.[month]=d.[month]
and a.[year]=b.[year] and b.[year]=c.[year] and c.[year]=d.[year]
order by a.[year]