Home  >  Article  >  Database  >  How to delete a row of data in a table using SQL statements?

How to delete a row of data in a table using SQL statements?

(*-*)浩
(*-*)浩Original
2019-05-05 18:06:2860623browse

You can delete a row of data in the table by using the SQL DELETE statement. The statement format is "DELETE FROM data table name WHERE field name = value"; according to the WHERE clause, define the deletion conditions for the deletion operation and specify the specific deletion Which row of data.

How to delete a row of data in a table using SQL statements?

Recommended courses: MySQL tutorial

SQL method to delete a row in a table:

How to delete a row of data in the table in Sql statement. Generally, you only need to add a condition to complete the operation of deleting a row.

First 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 line will do.

DELETE FROM table name WHERE primary key = ‘specific value’.

How to delete a row of data in a table using SQL statements?

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 for the data you want to delete.

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.

This completes the data operation of deleting a row.

The above is the detailed content of How to delete a row of data in a table using SQL statements?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn