Postgres Error: More than one row returned by a subquery used as an expression

后端 未结 6 1354
无人共我
无人共我 2020-12-01 09:24

I have two separate databases. I am trying to update a column in one database to the values of a column from the other database:

UPDATE customer
SET customer         


        
6条回答
  •  长情又很酷
    2020-12-01 09:46

    This error means that the SELECT store_key FROM store query has returned two or more rows in the SERVER1 database. If you would like to update all customers, use a join instead of a scalar = operator. You need a condition to "connect" customers to store items in order to do that.

    If you wish to update all customer_ids to the same store_key, you need to supply a WHERE clause to the remotely executed SELECT so that the query returns a single row.

提交回复
热议问题