[thelist] mysql update setting a value to null

Ben Phillips ben at inchima.com
Thu Apr 18 07:09:00 CDT 2002


i have a simple, simple problem that i can't get my head round... mainly
cos i have rarely used null values before.

i have a table:

EVENT
=====
eventid
startdate
enddate

and i want the enddate to be null if possible. this is fine.

so i have a record where endate IS NULL. however, if the enddate is then
set to a value, how do i UPDATE the record so that i can return the
value back to NULL?

i've tried 'UPDATE EVENT SET enddate = NULL'
           'UPDATE EVENT SET enddate = 'NULL''
           'UPDATE EVENT SET enddate IS NULL'

benji.





More information about the thelist mailing list