Update With Sub-Query

This error is present what do I change to be able to run this query?

Msg 116, Level 16, State 1, Line 5
Only one expression can be specified in the select list when the subquery is not introduced with EXISTS.

UPDATE abc
SET verified = '1'
WHERE employeenumber = '3'
AND grantedaccess IN (Select * from alphabet WHERE fullOnMaturity = 1)

July 22nd, 2015 8:30pm

UPDATE abc
SET verified = '1'
WHERE employeenumber = '3'
AND grantedaccess IN (Select grantedaccess 
from alphabet WHERE fullOnMaturity = 1)
Or another column you want to check against grantedaccess column.
Free Windows Admin Tool Kit Click here and download it now
July 22nd, 2015 8:41pm

Instead of * use any column name  or if that  is present in alphabate table

you can not use * in subquery while looking for a single column

UPDATE abc
SET verified = '1'
WHERE employeenumber = '3'
AND grantedaccess IN (Select  <grantedaccess /Col Name of alphabate table >  from alphabet WHERE fullOnMaturity = 1)

July 22nd, 2015 8:44pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics