I’m struggling with an Oracle query. I want to send a value to a inner query but I don’t succeed. My query looks as follows:
SELECT * FROM Pro u
LEFT JOIN (SELECT * FROM PROLOG d
WHERE d.Id = (SELECT MAX(Id) FROM PROLOG t
WHERE t.Project = **u.Id**
AND t.Prodstatus IN (5,40)))z ON (u.ID = z.Project)
WHERE u.Id = 22;
I want to replace the u.Id with 22. The value 22 comes from Pro u table. Please give me some hints.
You don’t need to pass that value to sub query from
Protable, You can useprologtable value