如何在以下查询中将Access中的sgn()
函数转换为T-SQL:
SELECT
DISTINCT Customer.Branch_ID,
Customer.Bankrupt,
-Sgn([Bankrupt]) AS [Counts]
FROM
Customer
答案 0 :(得分:2)
TSQL中的SIGN
:
返回的正数(+1),零(0)或负数(-1) 指定的表达式。
SELECT DISTINCT Customer.Branch_ID,
Customer.Bankrupt, -SIGN([Bankrupt]) AS [Counts]
FROM Customer