当@Keyword为declare from Store Procedure时,我有新的WHERE条件。但是当我尝试CASE语法时,我遇到错误“关键字‘LIKE’附近的语法不正确”。我已经在PostgreSQL中尝试了这种CASE语法,但没有错误。 ALTER PROCEDURE [dbo].InvoiceHead.Status
CASE
在这个查询中,我想添加一个新列,它给出了水的总和,但只给出了where PremiseProviderBillings.BillingCategory =‘a.VolumetricCharge’。但是我不想把它添加到明显的地方,因为那会限制返回的行数,我只想让它获得新的列值 -- Here i need SUM(a.VolumetricCharge) but where a.BillingCategory is equal to 'Water'
Sum(a.volumetriccharge