如此的sql语句,求原理 select a.Estimated_Arrival_Date_s from ( select estimated_arrival_date Estimated_Arrival_Date_s from Is_Issues_Plan_Detail where Estimated_Arrival_Date_s='aa' )a
select a.Estimated_Arrival_Date_s from (
select estimated_arrival_date Estimated_Arrival_Date_s from Is_Issues_Plan_Detail)a
where Estimated_Arrival_Date_s='aa'
------解决方案--------------------
declare @T table (col varchar(1))
insert into @T
select 'a' union all
select 'b' union all
select 'c'
--order by 后面就可以用别名
select col a from @T order by a
--where后面用别名的话就需要嵌套一层
select col a from @T where a='b'
/*
Invalid column name 'a'.
*/