Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> Problem z polem data gdy jest null
Stratoliner
post 28.11.2017, 11:16:13
Post #1





Grupa: Zarejestrowani
Postów: 22
Pomógł: 0
Dołączył: 11.03.2013

Ostrzeżenie: (0%)
-----




Mam problem z wykonaniem selecat dla wierszy z datą która jest nie wpisana.
Jest tabela: w której:

nrkro character(14) NOT NULL,
datur date,


W podglądzie mam wiersze np:
nrkro | datur |
005070936501 ||
AT007530709 |2005-01-15|

Nie mogę wyświetlić żadnego wiersza, który ma pole datur puste sciana.gif
Robię:

select * from tabela where datur=null
select * from tabela where datur=''
select * from tabela where datur=""
select * from tabela where datur=' - - '
select * from krowy where to_char(datur, 'YYYY-MM-DD')=''
select * from krowy where to_char(datur, 'YYYY-MM-DD')=' - - '
select * from krowy where to_char(datur, 'YYYY-MM-DD')=null

nic z powyższego nie działa tzn wynik jest pusty

Jakieś pomysły?
Go to the top of the page
+Quote Post
nospor
post 28.11.2017, 11:20:14
Post #2





Grupa: Moderatorzy
Postów: 36 440
Pomógł: 6290
Dołączył: 27.12.2004




Pierwsze wynki z googla

https://stackoverflow.com/questions/2376608...y-or-null-value
https://stackoverflow.com/questions/1417297...ct-empty-fields

zas jesli twoje pole ma wartosc poprostu null to wowczas
datur is null


--------------------

"Myśl, myśl, myśl..." - Kubuś Puchatek || "Manual, manual, manual..." - Kubuś Programista
"Szukaj, szukaj, szukaj..." - Kubuś Odkrywca || "Debuguj, debuguj, debuguj..." - Kubuś Developer

Go to the top of the page
+Quote Post
Stratoliner
post 28.11.2017, 11:34:41
Post #3





Grupa: Zarejestrowani
Postów: 22
Pomógł: 0
Dołączył: 11.03.2013

Ostrzeżenie: (0%)
-----


faktycznie wystarczyło:
SELECT * FROM tabela WHERE datur is null

Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Wersja Lo-Fi Aktualny czas: 28.03.2024 - 15:39