Re: Problem with Nested Inserts
Posted by:
Jay Pipes
Date: July 26, 2005 06:59PM
Error message is quite clear. The subquery returns more than one row. Since you are using the equality operator, the subquery is expected to return a single value, to compare to the bcode field. You should change the = to IN or better yet, use a join, which is generally more efficient:
INSERT INTO a (a4, a5, a6)
SELECT b3, b6, b7
FROM b
INNER JOIN a
ON b.bcode = a.acode;
Jay Pipes
Community Relations Manager, North America, MySQL Inc.
Got Cluster?
http://www.mysql.com/cluster
Personal:
http://jpipes.com
Subject
Views
Written By
Posted
6188
July 26, 2005 04:23PM
Re: Problem with Nested Inserts
3417
July 26, 2005 06:59PM
3052
July 27, 2005 12:23PM
3704
July 27, 2005 01:21PM
3320
July 27, 2005 02:11PM
3266
July 27, 2005 03:32PM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.