sql server - Updating table values with value from another table -


i'm trying update blank column values in table same column name. i've written statement values

select p.[id]       ,[patientid]       ,p.[clinicid]       ,[currentplannumber],         pin.clinicid   [productcheckout] p   inner join patients pin    on p.patientid=pin.id 

when try update columns error:

only 1 expression can specified in select list when subquery not introduced exists.

update [productcheckout]    set clinicid = (select p.[id]       ,[patientid]       ,p.[clinicid]       ,[currentplannumber],         pin.clinicid   [productcheckout] p   inner join patients pin    on p.patientid=pin.id) 

try this

 update pin    set pin.clinicid = p.[id]   [productcheckout] pin   inner join patients p   on pin.patientid=p.id 

Comments

Popular posts from this blog

Ansible - ERROR! the field 'hosts' is required but was not set -

customize file_field button ruby on rails -

SoapUI on windows 10 - high DPI/4K scaling issue -