【发布时间】:2015-08-17 16:20:54
【问题描述】:
如何在 sql server 中使用这个 mysql 查询?
如果我在 sql server 中使用相同的语法,则会收到以下错误。
“IN”关键字附近的语法错误
select count(1) as total_record
from sms_allocation
left join sms_api_definition on sms_allocation.sms_api_definition_id = sms_api_definition.sms_api_definition_id
where if(('1' = 1 || '4,26,28,31,32,33,37,41,53,56,58,62,63,66,71,72,73,75,76,77,81' = 81 || '4,26,28,31,32,33,37,41,53,56,58,62,63,66,71,72,73,75,76,77,81' = 82),
if('0'!='0',reseller_id in (
select reseller_id
from sms_allocation
where reseller_id in (0)),reseller_id in (
select reseller_id
from sms_allocation)
), reseller_id in (
select reseller_id
from sms_allocation
where reseller_id in (0)) and sms_allocate_to='Company');
【问题讨论】:
-
我正在将 mysql 代码迁移到 MS sql
标签: mysql sql-server