Search code examples
sqlitesql-delete

Sqlite delete data from columns


I have a table with 4 columns like this:

Date           Col1          Col2        Col3

27/03/2012     data          data        data

28/03/2012     data          data        data

I want to delete data from Col1 and Col2 from the row where date is 27/03/2012. Can anybody tell me how the query must be made?


Solution

  • Is this what you want?

    DELETE FROM tableName WHERE Col1="27/03/2012" OR Col2="27/03/2012"
    

    Update in response to some clarifications:

    To set Col2 to NULL for a particular date:

    UPDATE tableName SET Col2=NULL WHERE Date="27/03/2012"