我非常接近这个查询(SQL Server 2008 R2):
Select selectedicao, selectedyear, selectedmonth
From weatherdaily
Where Selectedyear = 1990 and selectedmonth = 1
Group By selectedicao, selectedyear, selectedmonth
输出:
selectedicao selectedyear selectedmonth
-------------------------------------------------
KPKB 1990 1
KORD 1990 1
KFWA 1990 1
KCDW 1990 1
KFDY 1990 1
KLCK 1990 1
我只需要在另一个名为kfactor
.
该列对于每个组都有数百个值,我无法在上述查询中为每个组列出一个值。