On 05-Jul-01 Ilan Fait wrote:
> 
> 
> Hi,
> 
>  I am trying to insert data from one table to another with the command:
> 
>  INSERT INTO attrib_values (attrib_id,attrib_value) values (Select
> attrib_id,attrib_default_value FROM attribs)
> 
>  And I get error massage:
> 
> You have an error in your SQL syntax near 'Select
> attrib_id,attrib_default_value FROM attribs)' at line 1
> 
> Why do I get this error and how can I insert the data from one table to the
> other?
> 

Your syntax is mixed-up.

INSERT INTO attrib_values (attrib_id,attrib_value) 
   Select attrib_id,attrib_default_value FROM attribs;

Regards,
-- 
Don Read                                       [EMAIL PROTECTED]
-- It's always darkest before the dawn. So if you are going to 
   steal the neighbor's newspaper, that's the time to do it.

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to