Delete specific values from column with where condition?

Delete specific values from column with where condition?


Here, I want to delete values/data from specific one column with the WHERE condition. I don't want to delete the complete row. It is possible like--


UPDATE TABLE SET columnName = null WHERE YourCondition

OR

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 */

Example:

In following table, I want delete Address of student which id is 2.

Here we write query for that as follows:

UPDATE Student
SET
    Address = NULL
WHERE
    Id = 2;
and Result is as follows:



Popular posts from this blog

SQL Basic- SQL Syntax

Type Declaration Instruction in C

SQL Basic- SQL Commands