Page 1 of 1

Select Everything Where A Certain Field Is Not Empty?

Posted: Thu Oct 24, 2002 10:35 am
by superwormy
How could I select everything where a certain field is not empty / is not null?

Using MySQL 3.23

Thaniks!

Posted: Thu Oct 24, 2002 10:57 am
by Crashin
SELECT * FROM tbl_name WHERE field_name IS NOT NULL :)

alternative

Posted: Thu Oct 24, 2002 1:57 pm
by phpScott
if your empty defualt values are not NULL then the following will work

SELECT * FROM tableName WHERE fieldName <>''

phpScott'

sorry

Posted: Thu Oct 24, 2002 1:58 pm
by phpScott
sorry about the double message i noticed to late that I had missed the second quote :oops:

Posted: Thu Oct 24, 2002 2:03 pm
by superwormy
Not a problem dude, thanks for all the help!!!

Re: sorry

Posted: Fri Oct 25, 2002 1:45 am
by twigletmac
phpScott wrote:sorry about the double message i noticed to late that I had missed the second quote :oops:
You can edit and delete your own posts :roll: :)
faq.php#15

Mac