Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Ordered subquery
Hi all!
I am trying to run this query and I am getting an error I can't understand:
select
t1.PER_COD, t1.DATASITUACIO as DATA_ALTA, (select t2.DATASITUACIO from tmpINTERVALS as t2 where t2.SITUACIO = 'B' and t1.PER_COD = t2.PER_COD and t2.DATASITUACIO > t1.DATASITUACIO and t2.ROWNUM = 1 order by t2.DATASITUACIO) as DATA_BAIXA from tmpINTERVALS as t1 where t1.SITUACIO = 'A' and t1.DATA_BAIXA is null or t1.DATA_BAIXA >= sysdate - 365
The error is "missing right parenthesis".
Any idea?
Thanks a lot,
Xavi Received on Wed Mar 28 2007 - 03:52:24 CDT