Home > database >  Batch will b table query results user_name one-to-one correspondence to a table corresponding to the
Batch will b table query results user_name one-to-one correspondence to a table corresponding to the

Time:10-10

A table b table
Id name id_number user_name

Update a set NAME=(select USER_NAME from b where id_number in (select id from where a length (id)=5 and id like '6%')) error ORA - 01427 single subquery return multiple rows for bosses

CodePudding user response:

Update a set NAME=(select USER_NAME the from where id_number in (select id from where a length (id)=5 and id like '6%'))

The username appeared more rows of data, which one do you want us to use?

CodePudding user response:

(select USER_NAME from b where id_number in (select id from where a length (id)=5 and id like '6%')) query result USER_NAME exist multiple records, according to the business need to handle the SQL, ensure USER_NAME there is no repeat

CodePudding user response:

First take a look at the id corresponding name in table B have unique value, is not the only values also added under the condition of screening
 select (select USER_NAME from b where Anderson, d=b.i d_number), Anderson d, A.N AME 
From where a length (id)=5 and id like '6%'

Update a set NAME=(select USER_NAME from b where Anderson, d=b.i d_number)
From where a length (id)=5 and id like '6%'
  • Related