Search code examples
sqlsql-server-2008sql-delete

Delete SQL Query


I want to delete rows of a column on the basis of condition of another column. For example:

DELETE FROM table_name column_name WHERE another_column_name='some value';

Solution

  • If you mean "delete the column", you can set it to null:

    UPDATE table_name SET
    column_name = null
    WHERE another_column_name = 'some value'