sql server 查询时显示新的列

时间:2021-04-13 00:39:08

select * ,(查询语句)as 别名 from 表名 where  条件


例如:

 select *,(select distinct ed.Mark as Mark from t_examinationDetail ed where paperID='p20140319194054' and timuType='单选题' ) as Mark from t_singleChoice sc where sc.id in(select distinct timuID from t_examinationDetail where paperID='p20140319194054' and timuType='单选题') order by sc.id

  go