table1 is a partitioned table with around 80 million records insertion per day.No indexes are present.
table 2 is having around 1.6 million records and table3 has about 100000 records.
The task is:
if col2=1 or 2, then, pick col3, match it with col6. If they are same, select col7 and finally display col1,col4 and col7
if col2=3 or 4, then, pick col3, match it with col10. If they are same, select col11 and finally display col1,col4 and col11.
Based on the values of col2(i.e., whether they are 1 or 2 and 3 or 4)I am trying to put the values of col3 in another (temp)table, say table4. Then into table 4, i am doing a select as insert from table2 or table3 based on the value of col2. The report will be generated using table4. So, my report will look, something like this: