Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Ordered subquery

Ordered subquery

From: <xaspas_at_gmail.com>
Date: 28 Mar 2007 01:52:24 -0700
Message-ID: <1175071944.315979.68720@n59g2000hsh.googlegroups.com>


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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US