View Single Post
Old 09-25-2008, 12:05 AM  
Phil
Confirmed User
 
Phil's Avatar
 
Join Date: Jan 2004
Posts: 7,659
Quote:
Originally Posted by Owen Pierce View Post
uhm... you said "DB1" and "DB2".. so.. I'm gonna assume you actually mean databases, although it seems more likely you mean tables... anyways.

INSERT INTO
db1.table
(field1,field2,field3)
SELECT
t2.field1,
t2.field2,
t2.field3
FROM
db1.table t2
LEFT OUTER JOIN db2.table t1 ON (t1.id = t2.id)
WHERE
t1.id IS NULL

databases.. each has identical structure.. I want to combine entries...
__________________
Ask Phil
Phil is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote