SQL 声明两列值 return 单个值
SQL Statement two columns value return single value
请建议构建 SQL 语句的最佳方法,非常感谢!
试试这个
select id,[date],(case when refund = 1 then 'R'
when voidstatus = 0 then 'C'
when voidstatus = 1 then 'V'
else '' end
) as [status],grossamt
from trans
请建议构建 SQL 语句的最佳方法,非常感谢!
试试这个
select id,[date],(case when refund = 1 then 'R'
when voidstatus = 0 then 'C'
when voidstatus = 1 then 'V'
else '' end
) as [status],grossamt
from trans