tags:

views:

25

answers:

2

Hi, I have two tables :

USER and USER_1

I want to insert datas from USER_1 to USER.

How to do it ?

I try to do it, but without success :

INSERT INTO USER WHERE id IN (SELECT * FROM USER_1)

+1  A: 

As long as you are sure the schemas are the same...

Use:

INSERT INTO USER
SELECT * FROM USER_1

This is the Syntax for SQL Server, not sure if it is identical in MySQL.

JNK
I would +1 this but I think you shouldn't assume that the tables have the same schema ;]
pablochan
Good point! You could always:DROP TABLE USER_1SELECT *INTO USER_1FROM User
JNK
perfect ! thanks
bahamut100
A: 

Maybe try this

 INSERT INTO USER 
               (Here is your columns)
         VALUES
               (SELECT * FROM USER_1)
bAN