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

Home -> Community -> Usenet -> c.d.o.misc -> Re: How to arrange this query ???

Re: How to arrange this query ???

From: Sybrand Bakker <postbus_at_sybrandb.demon.nl>
Date: Tue, 01 Aug 2006 20:02:19 +0200
Message-ID: <cn5vc2t1vtsbbtrapksmmo6scbd10fqm18@4ax.com>


On 1 Aug 2006 07:49:59 -0700, etantonio_at_libero.it wrote:

>Ciao,
>the query that works for me is the following :
>
>SELECT
> SIGN(COUNT(MTA.key1)) as "HiddenDestinoAssociato" ,
> MDA.COD_ABACUS "Cod. <br> Destino" ,
> MDA.Servizio "Servizio"
>
>from
> MAPLVANAG_DESTINI_ALL MDA , mapltelem_anag MTA
>
>where
> MDA.COD_abacus = MTA.key1(+)
>and MDA.SERVIZIO = MTA.key2(+)
>
>GROUP BY MDA.COD_abacus, MDA.SERVIZIO
>
>
>now I need to add another restriction regarding HiddenDestinoAssociato
>that have to be only 1 so I insert the following line in the where
>
> and SIGN(COUNT(MTA.key1)) == 1
>
>but Oracle signals to me an error, what happens ???
>
>Thanks
>
>Antonio D'Ottavio
>www.etantonio.it/en

simple
1 You are still top-posting. You are not human? 2 Group functions are only allowed in the HAVING clause. Elementary SQL.

--
Sybrand Bakker, Senior Oracle DBA
Received on Tue Aug 01 2006 - 13:02:19 CDT

Original text of this message

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