Hi,
I have a simple table with two keys: ID and count. Now I have a list of id's with their corresponding count that I want to integrate into the table in the following manner:
If ID exists in the table, update the count by adding the count in the table with the new count.
If ID does not already exist, append this ID and its count to the table.
My question is whether there is a way I could avoid looping thru the list of id's to first check its existence in the table before doing either UPDATE or INSERT. It just seems that there should be a faster way of doing it.
Thanks all.
Regards,
I have a simple table with two keys: ID and count. Now I have a list of id's with their corresponding count that I want to integrate into the table in the following manner:
If ID exists in the table, update the count by adding the count in the table with the new count.
If ID does not already exist, append this ID and its count to the table.
My question is whether there is a way I could avoid looping thru the list of id's to first check its existence in the table before doing either UPDATE or INSERT. It just seems that there should be a faster way of doing it.
Thanks all.
Regards,