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: Pls correct SQL. Urgent

Re: Pls correct SQL. Urgent

From: Noel <tbal_at_go2.pll-l>
Date: Tue, 19 Jul 2005 16:35:30 +0200
Message-ID: <dbj3bq$99g$1@inews.gazeta.pl>


Użytkownik KK napisał:

> Hi,
>
> Please correct this SQL which is returning multiple records.
>
> SELECT DISTINCT a.CALL_TIME, a.P_TRANSID, a.METHOD, b.CALL_STATUS, FROM
> DT_IPOS_CALL_LOG a, DT_IPOS_CALL_STATS b WHERE a.P_TRANSID IN (7569302)
> AND a.P_TRANSID = b.P_TRANSID (+) ORDER BY a.CALL_TIME
>
> The above query returns: ( pls notice it has 2 records for each )
>

Why b.P_TRANSID (+) ? Remove that '+'.

Please post results of following query:

SELECT DISTINCT a.CALL_TIME, a.P_TRANSID, a.METHOD, b.CALL_STATUS, b.p_transid
  FROM DT_IPOS_CALL_LOG a, DT_IPOS_CALL_STATS b   WHERE a.P_TRANSID IN (7569302)
    AND a.P_TRANSID = b.P_TRANSID (+) ORDER BY a.CALL_TIME;

I bet half of records have NULL as b.p_transid.

-- 
TomekB tbal_at_spam_go2_trap.pl GSM:Era 698093109
{Peugeot 306 ST, WY - 49245,       GG: 947-891}
Received on Tue Jul 19 2005 - 09:35:30 CDT

Original text of this message

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