I want to delete specific values/data from one column with the WHERE condition. Putting in another way, I don't want to delete the complete row. Is it possible?
This question is related to
sql
sql-server
sql-update
UPDATE YourTable SET columnName = null WHERE YourCondition
You can also use REPLACE()
:
UPDATE Table
SET Column = REPLACE(Column, 'Test123', 'Test')
UPDATE myTable
SET myColumn = NULL
WHERE myCondition
Try this SQL statement:
update Table set Column =( Column - your val )
You don't want to delete if you're wanting to leave the row itself intact. You want to update the row, and change the column value.
The general form for this would be an UPDATE
statement:
UPDATE <table name>
SET
ColumnA = <NULL, or '', or whatever else is suitable for the new value for the column>
WHERE
ColumnA = <bad value> /* or any other search conditions */
Source: Stackoverflow.com