Gossamer Forum
Home : General : Perl Programming :

MySql error with INSERT statement

Quote Reply
MySql error with INSERT statement
Can anyone tell me what is wrong with this statement. I'm getting an unknown table error. I do have the table. What I'm trying to do is move data from one table to another if there is a match on 3 fields.
Thanks

SQL-query :

INSERT INTO mdffl (ytd_points) SELECT week_1_fantasy_pts FROM week1
WHERE mdffl.player_last_name=week1.player_last_name and mdffl.player_first_name=week1.player_first_name and mdffl.position=week1.position


MySQL said:


Unknown table 'mdffl' in where clause

Quote Reply
Re: [barryb12000] MySql error with INSERT statement In reply to
It means the table mdffl doesn't exist. If you're sure it really does exist, check the case. MySQL is case sensitive when it comes to object names.
Post deleted by RedRum In reply to

Last edited by:

RedRum: Feb 15, 2002, 1:57 PM
Quote Reply
Re: [barryb12000] MySql error with INSERT statement In reply to
The case is correct, but I don't think this is possible in Mysql. Does anyone know work-around
Quote Reply
Re: [barryb12000] MySql error with INSERT statement In reply to
Try:

insert into tab1 (field1) select tab2.field_name from tab2 inner join tab3 on tab2.p_key = tab3.f_key where .....

TheStone.

B.
Quote Reply
Re: [barryb12000] MySql error with INSERT statement In reply to
Oh yeah, sorry. I didn't notice it was a correlated query. They are currently not supported in MySQL. All referenced tables must appear in the select clause of a query.

Last edited by:

paulj: Feb 15, 2002, 3:25 PM
Quote Reply
Re: [paulj] MySql error with INSERT statement In reply to
Thanks guys, I think that will work. I hope they add that function to the next version of MySql