当前位置:网站首页>MySQL - delete data in database tables
MySQL - delete data in database tables
2022-07-24 10:31:00 【Camellia Populus】
Delete the data in the database table
- Deleting data records is a common operation in data operations , You can delete existing data records in the table . stay MySQL Through DELETE Statement to delete data records , The SQL Statements can be used in the following ways : Delete specific data records 、 Delete all data records .
1. Delete specific data records
stay MySQL You can delete specific data records through SQL sentence DELETE To achieve , Its grammatical form is as follows :
DELETE FROM tablename WHERE CONDITION;In the above statement , Parameters tablename Indicates the table name of the data record to be deleted , Parameters CONDITION Specify to delete specific data records that meet the conditions .
mysql> create table class(id int, name varchar(64)); mysql> insert into class values(1, ' Zhang San '); mysql> insert into class values(2, ' Li Si '); mysql> delete from class where id=1; // Delete... From the table id by 1 The record of mysql> delete from class where name=' Li Si '; // Delete... From the table name by ' Li Si ' The record of mysql> select * from class;
2. Delete all data records
stay MySQL You can also delete all data records in SQL sentence DELETE To achieve , Its grammatical form is as follows :
DELETE FROM tablename WHERE CONDITION; or DELETE FROM tablename;In the above statement , To delete all data records , Parameters CONDITION Need to meet table tablename All data records in , Such as id>0; Or no keywords WHERE sentence .
mysql> create table class(id int, name varchar(64)); mysql> insert into class values(1, ' Zhang San '); mysql> insert into class values(2, ' Li Si '); mysql> delete from class; // Delete all records in the table mysql> select * from class;
边栏推荐
- 分布式锁-Redission 原理分析
- What does resource pooling and resource pooling mean?
- 《nlp入门+实战:第二章:pytorch的入门使用 》
- Sentinel implements the persistence of pull pattern rules
- Record AP and map calculation examples
- 谷歌联合高校研发通用模型ProteoGAN,可设计生成具有新功能的蛋白质
- Mysql database JDBC programming
- Sentinel 三种流控效果
- Sentinel 流量控制快速入门
- The concept and representation of a tree
猜你喜欢

zoj 2770 差分约束系统---2--2022年5月20日

谷歌联合高校研发通用模型ProteoGAN,可设计生成具有新功能的蛋白质

WEB安全基础 - - -文件上传(文件上传绕过)

分布式锁-Redission 原理分析

机器学习小试(11)验证码识别测试-使用Qt与Tensorflow2进行深度学习实验

分布式事务处理方案大 PK!

Homologous policy solutions

Intranet remote control tool under Windows

MySQL - 全文索引

2022, enterprise unified process platform design and integration specifications refer to thubierv0.1
随机推荐
Build a live broadcast platform based on webrtc
The best time to buy and sell stocks (leetcode-121)
[electronic device note 4] inductance parameters and type selection
Websocket 协议解读-RFC6455
Query about operating system security patch information
How many indexes are associated indexes under MySQL InnoDB?
[carving master learning programming] Arduino hands-on (59) - RS232 to TTL serial port module
Set up mail server with dynamic ip+mdaemon
MySQL - 索引的隐藏和删除
Nirvana rebirth! Byte Daniel recommends a large distributed manual, and the Phoenix architecture makes you become a God in fire
Erlang学习01
Configuration description and componentization development steps of various documents in the scaffold
JS function call download file link
Wechat applet
[sword finger offer II 115. reconstruction sequence]
Erlang学习02
Create a vertical seekbar from scratch
2022, our small goal
(3) Current situation of low code platform and R & D changes based on it basic components
图模型2--2022-5-13