Nested select statement in SQL Server 使用嵌套查询

Categories: Database; Tagged with: ; @ August 7th, 2012 11:19

In SQL Server, we need to alias the subquery, otherwise there will be syntax error.

SELECT name FROM (SELECT name FROM users) // Incorrect syntax near ‘)’
SELECT uTable.name FROM (SELECT name FROM users) uTable

 

 

<->



// Proudly powered by Apache, PHP, MySQL, WordPress, Bootstrap, etc,.