On Mon, 2004-05-17 at 13:37, P. Hill wrote: > Victoria Reznichenko wrote: > > "P. Hill" <[EMAIL PROTECTED]> wrote: > > > >>Why when there is a figurae, figurae2 table does the follow give an error? > >>INSERT INTO figurae2 SET id = figurae.id; > >> > >>The error is: > >>ERROR 1109 at line 35: Unknown table 'figurae' in field list > > > > Look at INSERT .. SELECT statement: > > http://dev.mysql.com/doc/mysql/en/INSERT_SELECT.html > > I'm not asking for an alternative way to do it; I'm asking what > is wrong with what I did?
Did you read: http://dev.mysql.com/doc/mysql/en/INSERT.html this page? Specifically, the second line of this page states: "The INSERT ... VALUES and INSERT ... SET forms of the statement insert rows based on explicitly specified values. The INSERT ... SELECT form inserts rows selected from another table or tables." You can only use one table in an insert and with the SET syntax it must have a specific value. The name after 'INSERT INTO' tells MySQL what table you intend to insert into, so when you tried to specify a second table you got the "Unknown table..." error. It looks like you want to copy over several or all values from a second table. The INSERT .. SELECT syntax isn't an alternate way, its the only way. > I did rework it to an alternative syntax, but I wanted to > use the SET syntax so I could list all my old fields right > next to my new fields, so that I didn't have to > skip up and down 40 lines to see how I have them matched up. > > So does INSERT ... SET ... work? How? > > -Paul > > -- . Garth Webb . [EMAIL PROTECTED] . . shoes * éå * schoenen * ëí * chaussures * zapatos . Schuhe * ÏÎÏÎÏÏÏÎÎ * pattini * é * sapatas * ÐÐÑÐÐÐÐ -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]