SQL Server : SUM() of multiple rows including where clauses

后端 未结 6 1599
死守一世寂寞
死守一世寂寞 2020-11-30 02:19

I have a table that looks something like the following :

  PropertyID     Amount     Type       EndDate
 --------------------------------------------
   1           


        
6条回答
  •  -上瘾入骨i
    2020-11-30 03:01

    sounds like you want something like:

    select PropertyID, SUM(Amount)
    from MyTable
    Where EndDate is null
    Group by PropertyID
    

提交回复
热议问题