Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Pls correct SQL. Urgent
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
![]() |
![]() |