Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
mana
Posting Yak Master
102 Posts |
Posted - 2014-09-24 : 03:33:32
|
HelloI have a table as dbo.Bewegungen and it will be updated every day with new datesI inserted once the values of this table to another table with group by. I want to know how should i insert the new valuse every day to the new table? i don't want to insert the previous valus again.it has 5 columns as primary key and one of them is Date.Can you help me please?Thank you |
|
Arun Babu N
Starting Member
26 Posts |
Posted - 2014-09-24 : 03:35:02
|
use not existsarunbabu |
|
|
mana
Posting Yak Master
102 Posts |
Posted - 2014-09-24 : 04:28:04
|
how should i use not existscan you help me please?for example the below code doesn't worki have 5 primary keys : datum, teil,id,workcenter and reason-codeinsert into dbo.Table_2 SELECT b.Datum_Bewegung, b.Teil_Nummer, b.Workcenter, b.Reason_Code, b.Menge, b.Id_Nr, b.Mengeneinheit FROM dbo.Bewegungen_Inventur_Korrekturen b WHERE not exists (SELECT * FROM dbo.Table_2 a WHERE b.Datum_Bewegung = a.Datum_Bewegung and b.Teil_Nummer=a.Teil_Nummer and b.Workcenter=a.Workcenter and b.Reason_Code=a.Reason_Code and b.Id_Nr=a.Id_Nr)quote: Originally posted by Arun Babu N use not existsarunbabu
|
|
|
|
|
|