多列子查询少了个','号
我用的是MSSQL,最近用了多列子查询,出错了。
位置在WHERE (ShipRegion,ShipCountry)这个地方
(服务器: 消息 170,级别 15,状态 1,行 2
第 2 行: ',' 附近有语法错误。):
select * from Orders
WHERE (ShipRegion,ShipCountry)
IN (SELECT ShipRegion,ShipCountry FROM Orders)
------解决方案--------------------
分开写不行吗?
select * from Orders
WHERE ShipRegion IN (SELECT ShipRegion FROM Orders) and ShipCountry in (select ShipCountry FROM Orders)