Results 1 to 5 of 5
  1. #1
    Join Date
    Sep 2002
    Location
    Toronto, Canada
    Posts
    76

    Unanswered: update a column to be null

    I have a column in a table, which has a value, how do I set it to be null? The column stores integers.


    The following doesn't work.

    update mytable set myNumber = null;

  2. #2
    Join Date
    May 2002
    Location
    Florida, USA
    Posts
    49
    Rule #1 when asking for help in a forum: never just say something "doesn't work". Always say exactly what the error message or response from the system was. This saves a lot of helpful people from taking the time to ask "what was the error message?"

    Rule #2: always explain the setting, such as "in the psql interface, I tried this query", or "inside this PHP code, I tried this query".

  3. #3
    Join Date
    Sep 2002
    Location
    Toronto, Canada
    Posts
    76
    to clarify:

    in a psql environment, what sql statement could I use to set a column to be null.

  4. #4
    Join Date
    May 2002
    Location
    Florida, USA
    Posts
    49
    Your syntax should have worked.

    You still didn't tell me what the error or response message was.

  5. #5
    Join Date
    Jan 2003
    Location
    Midwest
    Posts
    138
    I'm assuming that
    UPDATE tablename SET columnName = 'NULL' WHERE uniqueIdentifier = uniqueIdentifier
    didn't work?

Posting Permissions

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