0

我收到子查询返回多行的错误。如何解决这个问题:

UPDATE sales
    SET newsletter='0'
    WHERE (user_id='33' AND product_id=(SELECT product_id FROM phplist_list WHERE id = (SELECT listid FROM phplist_listmessage WHERE messageid='20')))
4

1 回答 1

2

您可以通过使用in而不是解决此问题=

UPDATE sales
    SET newsletter='0'
    WHERE user_id = '33' AND
          product_id in (SELECT product_id
                         FROM phplist_list
                         WHERE id in (SELECT listid
                                      FROM phplist_listmessage
                                      WHERE messageid = '20'
                                     )
                        )
于 2013-06-17T23:57:09.597 回答