select rows with column that is not null?

Posted by fayer on Stack Overflow See other posts from Stack Overflow or by fayer
Published on 2010-03-20T13:40:29Z Indexed on 2010/03/20 13:41 UTC
Read the original article Hit count: 317

Filed under:
|
|

by default i have one column in mysql table to be NULL.

i want to select some rows but only if the field value in that column is not NULL.

what is the correct way of typing it?

    $query = "SELECT *
            FROM names
            WHERE id = '$id'
            AND name != NULL";

is this correct?

© Stack Overflow or respective owner

Related posts about mysql

Related posts about sql