Subject | Subquery and returning "0" |
---|---|
Author | Łukasz Bączek |
Post date | 2014-07-12T13:57:11Z |
Hello,
I have a SQL query:
SELECT
CASE WHEN umowy.numer_umowy IS NULL THEN 0 END AS numer_umowy
FROM umowy
WHERE umowy.data_podpisania IS NOT NULL AND umowy.id_wnioski IN
(SELECT CASE WHEN wnioski.id_wnioski IS NULL THEN 0 END AS id_wnioski
FROM wnioski
LEFT JOIN kategorie_wnioskow ON
kategorie_wnioskow.id_kategorie_wnioskow=wnioski.id_kategorie_wnioskow
WHERE kategorie_wnioskow.id_kategorie_wnioskow_typ=1) AND umowy.rok=2014
How do I stop if "NUMER_UMOWY" is NULL is returned to "0" and not null
My database is Firebird 2.5
I have a SQL query:
SELECT
CASE WHEN umowy.numer_umowy IS NULL THEN 0 END AS numer_umowy
FROM umowy
WHERE umowy.data_podpisania IS NOT NULL AND umowy.id_wnioski IN
(SELECT CASE WHEN wnioski.id_wnioski IS NULL THEN 0 END AS id_wnioski
FROM wnioski
LEFT JOIN kategorie_wnioskow ON
kategorie_wnioskow.id_kategorie_wnioskow=wnioski.id_kategorie_wnioskow
WHERE kategorie_wnioskow.id_kategorie_wnioskow_typ=1) AND umowy.rok=2014
How do I stop if "NUMER_UMOWY" is NULL is returned to "0" and not null
My database is Firebird 2.5