Hi as the title suggest I would like to run a query that only shows New ID's.
Here is some test data
create table #tmpmerchant (Com_id int not null) insert #tmpmerchant values ('1234') insert #tmpmerchant values ('23456') insert #tmpmerchant values ('74895') insert #tmpmerchant values ('9578') insert #tmpmerchant values ('9579') insert #tmpmerchant values ('444889')
So the first time this runs it will return all records.
I then want to store these IDs in a permanent table.
When the query is next run it will only show new IDs that are not in the permanent table.
insert #tmpmerchant values ('1234') insert #tmpmerchant values ('23456') insert #tmpmerchant values ('74895') insert #tmpmerchant values ('9578') insert #tmpmerchant values ('9579') insert #tmpmerchant values ('444889') insert #tmpmerchant values ('54789')
So in this example '54789' will only show.
The permanent table is then updated with the '54789'
What would be the best way to achieve this?
Regards