INSERT INTO [dbo].[dm_pmp_scores]
           ([fosid],[fycode],[empid],[fullname],[jobgrade],[meritrate],[perfrate],
[potband],[hrres],[isdirty],criticality,promotability,PostRanking,iscommited) 
select '75DA940A-5436-4866-8D44-FE1890E2C0F6','FY0607','tt0042',
(select distinct fullname,jobGrade from [vw_pat_users] where EmployeeID='tt0042'),'A','B','Band 2','','0','','','',0
报错
Only one expression can be specified in the select list when the subquery is not introduced with EXISTS

解决方案 »

  1.   

    select distinct fullname,jobGrade from [vw_pat_users] where EmployeeID='tt0042'得到的是一个集合 所以有问题 这样的赋值只能是单个的值。
      

  2.   

    INSERT INTO [dbo].[dm_pmp_scores]
      ([fosid],[fycode],[empid],[fullname],[jobgrade],[meritrate],[perfrate],
    [potband],[hrres],[isdirty],criticality,promotability,PostRanking,iscommited)  
    select distinct '75DA940A-5436-4866-8D44-FE1890E2C0F6','FY0607','tt0042', fullname,jobGrade ,'A','B','Band 2','','0','','','',0
    from [vw_pat_users] where EmployeeID='tt0042'
      

  3.   

    select song.song_name,song.title_url,song.mv_url,singer.singer_name from WEBDB_PROD_SONG as song, WEBDB_PROD_SINGER as singer where song.singer_id=singer.singer_id and song.song_name=(select * from WEBDB_PROD_SONG where song_name='F289D7C4')我这个呢?
      

  4.   

    求解释 消息 116,级别 16,状态 1,第 1 行
    当没有用 EXISTS 引入子查询时,在选择列表中只能指定一个表达式。