MySQL Forums
Forum List  »  New in 4.1: Subqueries

Problem with Nested Inserts
Posted by: Juan Javaloyes
Date: July 26, 2005 04:23PM

This is my problem. I have two tables (let's called "a" and "b"). I need to load all the columns (specifically, 15.000) "a4", "a5" and "a6" from "a" with data from columns "b3", "b6" and "b7" from "b" (being same datatype), where "acode" (on "a") = "bcode" (on "b"). I did this (the closest solution I tried, at least):

insert into a (a4, a5, a6)
select b3, b6, b7
from b
where bcode = (select acode from a)

The error says "Subquery returns more than 1 row"

I must say all columns on "a" (except those I want to be loaded) are already loaded with data, included (of course!) "acode"
I know this may had a simple solution, but I tried everything, may I be just tired?

Options: ReplyQuote


Subject
Views
Written By
Posted
Problem with Nested Inserts
6000
July 26, 2005 04:23PM
3322
July 26, 2005 06:59PM
2955
July 27, 2005 12:23PM
3609
July 27, 2005 01:21PM
3218
July 27, 2005 02:11PM
3161
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.