Thursday 31 May 2012

mysql blank field not returning as null

i seem to be having a problem checking to see if a column is NULL or not .  I know the results are empty however

SELECT *
FROM employee_info
WHERE employee_first_name IS NULL;

isn't returning the results I want.

Let's try and rethink the search terms I'm using.

I searched for

mysql how to find fields that are empty

Here's my next seaches:

mysql blank field not returning as null

mysql field empty but not returning as null


and this is what I got from this post http://forums.digitalpoint.com/showthread.php?t=29204

SELECT * FROM employee_info WHERE employee_first_name = '';

so if you wanted to check for all rows that did have something in the 'employee_first_name' field you could use.

SELECT * FROM employee_info WHERE employee_first_name > '';

No comments: