Hi,
I have a question about the best solution in selecting data from two tables and one of it is a temp table.
If ID is found on both tables, only the temp_table row should be selected. My solution looks like:
ORIG_TABLE
PK_ID
Data1
Data2
status_cd
TEMP_TABLE
PK_ID
Data1
Data2
status_cd
select data1, data2, status_cd from ORIG_TABLE
where pk_id not in (select pk_id from temp_table)
union
select data1, data2, status_cd from TEMP_TABLE
I wonder if there is an easier way in selecting data like that.
Thanks ahead,
Tobias