The commented (/* */) part of this query executes but the whole query am getting problem in /////// part.Please hlep to solve this.
SELECT *
FROM (
/* (SELECT U1.EMAIL, S1.GRNNUM
FROM RDT_USER U1,
(SELECT O.ID, GRNNUM
FROM RDT_ORGANIZATION O,
(SELECT GRNNUM, RECEPIENTCODE, ORGINATORCODE
FROM RDT_GOODSRECEIPTNOTE M
WHERE M.ACTIONSTATUS = 0
AND M.LATEST = 1
AND (SYSDATE - M.GENDATE) >= 0) S
WHERE O.FUCODE = S.ORGINATORCODE) S1
WHERE U1.ORGID = S1.ID)*/ A///////here am getting right paranthesis missing,
(SELECT U.EMAIL, T1.GRNNUM
FROM RDT_USER U,
(SELECT O.ID, GRNNUM
FROM RDT_ORGANIZATION O,
(SELECT GRNNUM, RECEPIENTCODE, ORGINATORCODE
FROM RDT_GOODSRECEIPTNOTE M
WHERE M.ACTIONSTATUS = 0
AND M.LATEST = 1
AND (SYSDATE - M.GENDATE) >= 0) T
WHERE O.FUCODE = T.ORGINATORCODE) T1
WHERE U.ORGID = T1.ID) B)
WHERE A.GRNNUM = B.GRNNUM
Those two subqueries/inline views need to be connected in some way. You probably want a cross join — indicated by the comma between them — in which case, you can also remove a set of parentheses:
EDIT The more I look at your query, the more I see problems with it.
The core of your query is basically this logic:
You are then cross joining this with
rdt_organization, then cross joining that withrdt_user; this mess is then crossed with itself, for some reason. This can be greatly simplified with inner joins:There’s no reason for you to do this twice, in a cross join, so that’s it. Much easier, huh?