Theorp
Theorp

Reputation: 151

SQL to add only new data

I'm using Pentaho Data Integration, and in it, I make a selection in database X, where I get some information with filters, then I need to update this information in database Y. However, I need to ignore the data already recorded and just add the new data, as can i do this with a sql?

Upvotes: 0

Views: 174

Answers (2)

Ali Kavoosi
Ali Kavoosi

Reputation: 11

if your fields names are same in tables you can use this query:

insert into Y.dbo.Y_1(fieldName) select fieldName from X.dbo.X_1

Upvotes: 1

Ismail Diari
Ismail Diari

Reputation: 519

you could use a merge statment for that

Upvotes: 1

Related Questions