Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> HELP : Problem with 'Not In'
Hi,
I have a problem with this request :
SQL> SELECT T3.PRCORT, T4.WICDU,
2 substr(T4.WIDATE_OF,1,2)||'/'||substr(T4.WIDATE_OF,3,2)||'/'||substr(T4.WIDATE_OF,5,2) 3 ||' '||substr(T4.WIDATE_OF,8,2)||':'||substr(T4.WIDATE_OF,10,2), 4 substr(T4.WIDLUO,1,2)||'/'||substr(T4.WIDLUO,3,2)||'/'||substr(T4.WIDLUO,5,2) 5 ||' '||substr(T4.WIDLUO,8,2)||':'||substr(T4.WIDLUO,10,2) 6 ||lpad(SUM(T4.WIQTE),6)||rpad(to_char(sysdate,'DD/MM/YYHH24:Mi'),14)
*
But if run the sub-querie :
SQL> select substr(lfgden,9,3)
2 from werr, cs021_at_db_w_cstk
3 where
4 TRAITEMENT like 'cs01%' and
5 substr(TRAITEMENT,5,2) = CSID and
6 WID IS NOT NULL and
7 paco = substr(TRAITEMENT,7,2);
SUB
--- 219Received on Wed Mar 17 2004 - 04:41:37 CST
=> it works
and if I write '219' in the main request instead of the sub-querie : SQL> SELECT T3.PRCORT, T4.WICDU, 2 substr(T4.WIDATE_OF,1,2)||'/'||substr(T4.WIDATE_OF,3,2)||'/'||substr(T4.WIDATE_OF,5,2) 3 ||' '||substr(T4.WIDATE_OF,8,2)||':'||substr(T4.WIDATE_OF,10,2), 4 substr(T4.WIDLUO,1,2)||'/'||substr(T4.WIDLUO,3,2)||'/'||substr(T4.WIDLUO,5,2) 5 ||' '||substr(T4.WIDLUO,8,2)||':'||substr(T4.WIDLUO,10,2) 6 ||lpad(SUM(T4.WIQTE),6)||rpad(to_char(sysdate,'DD/MM/YY HH24:Mi'),14) 7 FROM wiof T4, wiprcort T3 8 WHERE T4.WIART=T3.PRCO 9 AND T4.WICDU not in ('219') 10 GROUP BY T3.PRCORT , T4.WICDU , T4.WIDATE_OF , T4.WIDLUO ; PRCORT WIC SUBSTR(T4.WIDA SUBSTR(T4.WIDLUO,1,2)||'/'||SUBSTR ------ --- -------------- ---------------------------------- 000086 050 22/03/04 00:00 03/06/04 00:00 6117/03/04 10:34 000346 001 26/03/04 00:00 13/09/04 00:00 392517/03/04 10:34 000375 001 24/03/04 00:00 13/09/04 00:00 392017/03/04 10:34 ... 429 rows selected.
=> It's works ...
I think it's a problem with the NOT IN and a sub-querie but i don't understand why ! Do you have any idea about this ? Arnaud
![]() |
![]() |