我有以下SQL
set @ID = '323232'
select
tt.ItemOrder, tt.DisplayVal,
ActualDate = (select mfdate from mfseries where Id = @ID)
from
tblTime tt
有没有办法简化此查询以不使用子查询?
答案 0 :(得分:1)
DECLARE @date datetime
select @date = mfdate from mfseries where Id = @ID
select tt.ItemOrder,tt.DisplayVal,@date As ActualDate
from tblTime tt