0
acquisitionID    Logno.             FundName
1               2                   Allocated
1               2                   Potential
2              34                   Allocated
3              37                   Potential
4              40                   Allocated
4              40                   Potential
5              39                   Potential

如果有两个资金,我只想显示那些将 FundName 设为 Allocated 的行,即(Allocated/Potential),否则我想按原样显示。IE

acquisitionID   Logno.               FundName
1               2                   Allocated
2               34                  Allocated
3               37                  Potential
4               40                  Allocated
5               39                  Potential   
4

1 回答 1

1
SELECT AcquisitionID, [LogNo.], min(FundName)
FROM myTable 
GROUP BY AcquisitionID, [LogNo.]
于 2013-10-09T22:02:06.250 回答