I am trying to copy the column fields from one table to another already created work, however, I am getting this error

Asked

Viewed 32 times

0

UPDATE variaveis_copy 
 SET descricao = (
  SELECT descricao FROM variaveis WHERE variaveis.variavel = variaveis_copy.variavel
 ) 

(ERROR: more than one Row returned by a subquery used as an Expression)

  • The message is clear. Use the primary key to correlate the tables or choose only one of the returned descriptions.

  • its subquery is returning more than one line and that of the error in the update, which is expecting only one line

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.