[snip]
INSERT INTO Customer_Equipment SELECT Customer.ID, Server_ID,
Configuration, Equipment_Type, Group_ID, Location, Rack_Location,
Network_Status_Name, Creator_ID, Primary_IP_Address FROM
Customer_Equipment, Customer WHERE SUBSTRING(Server_ID, 5,4) =
Customer.User_ID;

The select statement works perfectly, but when I try to combine the select
statement with an INSERT INTO statement (I've done this in the past), I get
the error message:

        ERROR 1066: Not unique table/alias: 'Customer_Equipment'
[/snip]

You cannot INSERT into a table that you have SELECT 'ed from;

INSERT INTO Customer_Equipment SELECT ...
FROM Customer_Equipment, Customer ....

HTH!

Jay
sql, mysql, query



---------------------------------------------------------------------
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