Inner Join - Oracle
UNIT_COST Number; /* We have to define a variable to retrieve the value from select query.*/
select min(tbl1.price) INTO UNIT_COST
from tbl2
INNER JOIN tbl3
ON
tbl2.RequestID = tbl3.RequestID
INNER JOIN tbl4
ON
tbl3.SiteID = tbl4.SiteID
INNER JOIN tbl5
ON
tbl4.Band = tbl5.Band
INNER JOIN tbl6
ON
tbl5.genitmepriceid = tbl6.genitmepriceid
WHERE tbl6.accantreqid = ACC_ANT_REQID
from tbl2
INNER JOIN tbl3
ON
tbl2.RequestID = tbl3.RequestID
INNER JOIN tbl4
ON
tbl3.SiteID = tbl4.SiteID
INNER JOIN tbl5
ON
tbl4.Band = tbl5.Band
INNER JOIN tbl6
ON
tbl5.genitmepriceid = tbl6.genitmepriceid
WHERE tbl6.accantreqid = ACC_ANT_REQID
-- I have renamed the table names to understand easily.
Comments
Post a Comment