SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    Knowledge is key 2 progression Tryst's Avatar
    Join Date
    Sep 2003
    Location
    Wales
    Posts
    1,181
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Deleting rows containing NULL values.

    Hi all,

    How do I delete a row where the criteria on the row to be deleted is NULL.

    An example, I have a table called images, and one of the columns is called location. So if I wanted to delete all the rows in the images table where the value in the location column = NULL, how do I create the query?

    So far I have tried the following in my queries...

    WHERE location = NULL;
    WHERE location = 'NULL';
    WHERE location = "NULL";

    But to no avail.

    Thanks

    Tryst

  2. #2
    SitePoint Member
    Join Date
    Sep 2002
    Location
    Ohio
    Posts
    13
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Try "WHERE location IS NULL"

  3. #3
    Knowledge is key 2 progression Tryst's Avatar
    Join Date
    Sep 2003
    Location
    Wales
    Posts
    1,181
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thats worked a treat.

    Thank you, kcomer.

    Tryst


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •