更新SQL语句中,子查询返回多行值 无法执行。如何解决?

2025-02-24 08:45:28
推荐回答(3个)
回答1:

把子查询前面的=换成 in 试试?
update study set received_code='TAIYCG1' where received_code in (SELECT study.received_code FROM STUDY,series WHERE study.studyinstanceuid=series.studyinstanceuid and SONGJIANDANWEI LIKE '%水西关%' and seriesdate between'2012-1-1' and '2012-4-6'and workflow='st' )

回答2:

update study set received_code='TAIYCG1' where received_code
in (SELECT study.received_code FROM STUDY,series WHERE study.studyinstanceuid=series.studyinstanceuid and SONGJIANDANWEI LIKE '%水西关%' and seriesdate between'2012-1-1' and '2012-4-6'and workflow='st' )

试试这个!

回答3:

改成in