我正在尝试运行以下查询(针对 Foodmart 2000),它在 MySQL 上运行良好。在 SQL Server 2005 上,我得到的只是“' 附近的语法错误”消息。
SELECT * FROM ((SELECT COUNT(state_province) AS 'WA'
FROM customer c1
WHERE c1.state_province LIKE 'WA'
GROUP BY c1.state_province) as t1,
(SELECT COUNT(state_province) AS 'OR'
FROM customer c1
WHERE c1.state_province LIKE 'OR'
GROUP BY c1.state_province) as t2,
(SELECT COUNT(state_province) AS 'CA'
FROM customer c1
WHERE c1.state_province LIKE 'CA'
GROUP BY c1.state_province) as t3);
究竟是什么导致了这个问题?