SELECT [aid], CASE WHEN [aid] = 1126 THEN (SELECT SUM([ANumber]) FROM [Auction] ) ELSE [ANumber] END AS ANumber
FROM [Auction]
因为你按aid,ANumber分组了,所以aid和ANumber都是有对应关系的,所以sum的值仍然是原来ANumber的值。
但是后面不加gourp by 就会出错,然后呢,请问大牛, 那我应该怎么查询。
@t101lian: 表结构是?