I have two oracle select queries like
SELECT loc.location AS LOCATION , req.requisition AS REQ
FROM location_view loc, requisition_view req, association ass
WHERE loc.name = 'ABC' AND req.name = 'TRANSFER'
AND ass.entity_id_2 = req.entity_id AND ass.entity_id_1 = loc.entity_id
And the result looks like:
Other query is like:
SELECT req.requisition AS req, exp.experiment AS expt
FROM experiment_view exp, requisition_view req, association_view ass
WHERE expt.name = 'RETRIEVAL'AND req.name = 'TRANSFER'
AND ass.entity_id_2 = req.entity_id AND ass.entity_id_1 = expt.entity_id
Result:
I am trying to combine these two SELECT
queries so I get to see these results:
Should I be using Sub-Queries to see the combined result or is there any other way of optimizing?
ass.entity_id_1
to be used to match both thelocation_view
view and theexperiment_view
view?