Hello,
I currently use lots of UNION queries in my Database, which is a huge strain on performance and i'm looking to adopt a different method. I would like to create a tempory table, which does two things. Depending on the query I will write, I would like some data to be 'updated' into the table and therefore not delete it. And I would like some data to completely override what is already in there.
To Summarise...
This Query (call it 'Query2') will replace anything in 'TemporyTable' with anything that is in 'Query1' once Query2 has been run.
Code:
SELECT * INTO TemporaryTable
FROM Query1;
What I need is the correct SQL statement to 'add' the information from 'Query1' into 'TemporaryTable' without deleting the current data. I had a go with the below, which simply didn't work. I've used the same naming conventions, as once I understand how it can work I can adopt to what I'm trying to do.
Code:
SELECT UPDATE * INTO TemporaryTable
FROM Query1;