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 -> Re: Ordered subquery

Re: Ordered subquery

From: Carlos <miotromailcarlos_at_netscape.net>
Date: 28 Mar 2007 03:09:01 -0700
Message-ID: <1175076541.127390.197040@p15g2000hsd.googlegroups.com>


On 28 mar, 10:52, xas..._at_gmail.com wrote:
> 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

Pueba a escribir código SQL decente. (El prefijo tmp en tmpINTERVALS da cierto tufillo a tablas temporales/SQLServer żno?)

Saludos.

Carlos. Received on Wed Mar 28 2007 - 05:09:01 CDT

Original text of this message

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