Optimized use of views??
please consider below two approaches:-
table TEMP_TABLE1 contains data for around 1000 resources.
1st Approach:-
--create view for one resource
Create view TEMP_VIEW_100 as select * from table1 t1, table2 t2 where t2.resource_id = 100 and t1.resource_id = t2.resource_id
then we will use this view to find difference between data returned by this view and data in a table TEMP_TABLE1 with same structure using below query:-
SELECT resource_id, task_number, task_assignment_id, escalation_task_number,
esc_level_name, esc_summary, esc_status, esc_reason, party_name
FROM (SELECT MIN (tablename) AS tablename, resource_id, task_number,