Re: SQL: Selecting empty rows
| From: | facosta at ops dot magnux dot com dot br | Date: | Tue, 07 Nov 2000 14:32:22 +0000 |
| Subject: | Re: SQL: Selecting empty rows | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-24097@lists.php.net to get a copy of this message | ||
On Tue, 7 Nov 2000, Martin wrote:
> Hi !
>
> I got php4 and Postgresql 6.5.
> I created a fresh table with some fields, espacialy a text-field (lets
> call it "test").
> I filled in about 10 rows.
> In 3 rows, I filled the field test with some text.
I think this row allow NULL. So you have 3 rows with some values and 7
with NULL
>
> What I want to do:
> 1.) Select all fields, where the field "test" is emtpy.
Try this
select * from table where test is null
If you want to select everything but the null you can use
select * from table where test is not null
> 2.) Select all fields, where a string is NOT inside the field "test".
>
> I tried:
> select * from table where test='';
> select * from table where test like '';
> select * from table where test not like 'string';
>
> But I never get any rows back, where the field "test" has not been set.
>
> Please help !
>
> Regards
>
> Martin
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>