yogogeri
yogogeri

Reputation: 1

Inserting from a database to another using where clause

DATABASE A           DATABASE B
TABLE ABC            TABLE ABC
NAME   ACNO          NAME   ACNO
A        4444        A      4444
B        4444        B      4444
C        5555        C      5555
                     D      5555 

how to insert to a database A table name ABC and specific account 5555 FROM database B table name ABC a specific account 5555

Upvotes: 0

Views: 37

Answers (1)

MarzSocks
MarzSocks

Reputation: 4318

Try something like this:

INSERT INTO A.ABC (NAME, ACNO) 
SELECT NAME, ACNO FROM B.ABC WHERE ACNO=5555

Obviously replacing "A" and "B" with your database names.

Upvotes: 1

Related Questions