例如:
如果我尝试
select job from (select ename as "name", job from emp)
有效但
select name from (select ename as "name", job from emp)
不
即使这不起作用。
select a.name from (select ename as "name", job from emp) a
答案 0 :(得分:1)
使用SQL Server 2008R2
SELECT
A.Name
FROM
(SELECT
FormStatus AS [Name],
FormStatusCodeID
FROM
CodeFormStatus) AS A
按预期工作。(使用现有表进行测试)
答案 1 :(得分:0)
select a.name from (select ename as "name", job from emp) as a