Обсуждение: SQL query not returning the value expected !!!!!!!!!!!!!!!!!!

Поиск
Список
Период
Сортировка

SQL query not returning the value expected !!!!!!!!!!!!!!!!!!

От
"Najib Abi Fadel"
Дата:
Hi if you take  a look at the following query's you can see that the third query should logically return  043219
but instead it's not returning any rows ?? What's happening ??????????????
 
dragon=> SELECT cod_etu from parcours_v where cod_etu = '043219';
 cod_etu
---------
(0 rows)
 
dragon=> SELECT cod_etu from parcours_hors_cursus_v where cod_etu = '043219';
 cod_etu
---------
 043219
(1 row)
 
dragon=> SELECT cod_etu from parcours_hors_cursus_v where cod_etu ='043219' and cod_etu not in (select cod_etu from parcours_v);
 cod_etu
---------
(0 rows)

Re: SQL query not returning the value expected !!!!!!!!!!!!!!!!!!

От
Stephan Szabo
Дата:
On Mon, 10 Nov 2003, Najib Abi Fadel wrote:

> Hi if you take a look at the following query's you can see that the
> third query should logically return 043219 but instead it's not
> returning any rows ?? What's happening ??????????????

Are there any NULLs in parcours_v.cod_etu?  NOT IN works oddly when
combined with NULLs.

Re: SQL query not returning the value expected !!!!!!!!!!!!!!!!!!

От
"Najib Abi Fadel"
Дата:
thanx this was the problem : the null values ....

----- Original Message -----
From: "Stephan Szabo" <sszabo@megazone.bigpanda.com>
To: "Najib Abi Fadel" <nagib.abi-fadel@usj.edu.lb>
Cc: "generalpost" <pgsql-general@postgresql.org>
Sent: Monday, November 10, 2003 07:58 PM
Subject: Re: [GENERAL] SQL query not returning the value expected
!!!!!!!!!!!!!!!!!!


>
> On Mon, 10 Nov 2003, Najib Abi Fadel wrote:
>
> > Hi if you take a look at the following query's you can see that the
> > third query should logically return 043219 but instead it's not
> > returning any rows ?? What's happening ??????????????
>
> Are there any NULLs in parcours_v.cod_etu?  NOT IN works oddly when
> combined with NULLs.
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: Have you searched our list archives?
>
>                http://archives.postgresql.org