Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 499
Taziano Avatar asked Mar 03 '26 18:03

Taziano


1 Answers

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"
like image 140
Alex Wilson Avatar answered Mar 06 '26 18:03

Alex Wilson