|
|
|
#1 |
|
Messages: n/a
Hébergeur: |
Can i make multiple inserts into a table using one statement.
the statement: INSERT INTO table1 (UserName) VALUES (SELECT DISTINCT UserName FROM table2) Basically, i want to take out all the UserNames from table2 and insert them into table1. It doesnt work, why? Thanks Wes |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
wesley@ispace.co.za wrote:
> Can i make multiple inserts into a table using one statement. > the statement: > INSERT INTO table1 (UserName) VALUES (SELECT DISTINCT UserName FROM > table2) This one trips me up from time to time. Take out the word 'VALUES'. Refer to syntax documented here: http://dev.mysql.com/doc/refman/5.0/en/insert.html Regards, Bill K. |
|
![]() |
| Outils de la discussion | |
|
|