On Wednesday, March 23, 2005 12:13, Graham Anderson wrote:

> how do you search for an empty field ?
> I want to filter out records where the ipAddress field is empty
> 
> SELECT * FROM 'userLog'  WHERE 'ipAddress' IS  [empty] ?

Searching for NULL's --
SELECT * FROM userLog WHERE ipAddress IS NULL

Searching for empty string --
SELECT * FROM userLog WHERE ipAddress = ''

Or either --
SELECT * FROM userLog WHERE ipAddress IS NULL OR ipAddress = ''

There is no space between the single quotes.

-- 
Tom Crimmins
Interface Specialist
Pottawattamie County, Iowa

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to