JWi*_*ing 3 mysql t-sql sql-server
我正在将mysql sprocs转换为SQL Server.我在mysql中遇到一个select语句,我不太明白它在做什么,而我的google-fu/so-fu让我失望了.以下是它的要点:
SELECT AccountType = dbo.functionToGetAccountType() FROM AccountLookup
Run Code Online (Sandbox Code Playgroud)
我没有能力调试原始的mysql.我知道该函数只返回一个值.
如果AccountLookup表中没有行,mysql语句是否将默认值分配给"AccountType"?
谢谢你的时间.
select语句正在执行该函数dbo.functionToGetAccountType()并将列别名为AccountType.它可以重写为:
SELECT dbo.functionToGetAccountType() as AccountType
FROM AccountLookup
Run Code Online (Sandbox Code Playgroud)