I need to insert asset pricing data from one table that is updated multiple times daily, to another table containing historical data. The fields in both tables are:
Symbol, Date, Price.
However, I would like to avoid duplicate Symbol/Date combinations (i.e. in the historical pricing table only one price exists for a symbol on a particular date), ideally overwriting earlier pricing on the same day.
I think I need to use the INSERT command but with some additional 'overwrite if Symbol/Date already present' command. This is what I currently have, which as you can see, only inserts the data.
Expand|Select|Wrap|Line Numbers
- INSERT INTO AssetPrices
- SELECT *
- FROM LivePricing;