In SQL, you can delete a certain row of data through the DELETE method, using syntax such as "delete from ms_cf01 where brxm='Zhang San' and id='7598';", where "ms_cf01" indicates the row to be deleted. The table to which the data belongs.
The operating environment of this article: Windows 7 system, Dell G3 computer, SQL Server 2016.
First of all, you need to determine which fields or field combinations can uniquely determine your row of data.
DELETE FROM table name WHERE field 1 = '' and field 2 = '' and... .Field 1,... is a field combination that can uniquely determine a certain row of data. Just fill in the specific value of the field you want to delete in ''
If there is a primary key, directly use the primary key to determine a certain row. That's it.
DELETE FROM table name WHERE primary key = ‘specific value’.
delete from ms_cf01 where brxm='张三' and id='7598';
where: ms_cf01 is what you want Delete the table to which that data belongs.
brxm, id is the condition under which you want to delete the data.
The effect of the above statement is to delete the row data in table ms_cf01 that matches brxm equals Zhang San and id equals 7598.
【Recommended learning: SQL video tutorial】
The above is the detailed content of How to delete a row in sql. For more information, please follow other related articles on the PHP Chinese website!