MySQL SELECT only not null values

Is it possible to do a select statement that takes only NOT NULL values?

Right now I am using this:

SELECT * FROM table

And then I have to filter out the null values with a php loop.

Is there a way to do:

SELECT * (that are NOT NULL) FROM table

?

Right now when I select * I get val1,val2,val3,null,val4,val5,null,null etc…. but I just want to get the values that are not null in my result. Is this possible without filtering with a loop?

10 Answers
10

Leave a Comment