Reputation: 769
Select Value1,Value2,Value3 from Table1 where time > DATEADD(DAY,-2,GETDATE())
ordery BY time desc
Result :
Value1=25
Value2=50
Value3=70
How can I change result to be
Value1=25
Value2=0 (if Value2=50 it will be 0)
Value3=70
Upvotes: 1
Views: 82
Reputation: 263933
If I understand you correctly, you can use CASE
statement,
SELECT Value1,
CASE WHEN Value2 = 50 THEN 0 ELSE Value2 END Value2,
.....
Upvotes: 4