当前位置:网站首页>mysql写的代码数据 增删查改等等
mysql写的代码数据 增删查改等等
2022-06-24 07:06:00 【隐密修罗】
新增数据:INSERT INTO ‘数据库名称’ set
INSERT INTO active set keyword = ‘1’,img_time = ‘2019-07-01’
删除数据:DELETE from ‘数据库名称’
DELETE from active where 1 = 1 and active_id = ‘19c61c32bd349896’
详情数据:select * from ‘数据库名称’
select * from active where 1 = 1 and active_id = ‘1af8bad12c1515b3’
修改数据:update ‘数据库名称’ set
update active set active_id = ‘19c61c32bd349896’,keyword = ‘666’
修改某个数据:update ‘数据库名称’ set
update active set check_status = ‘2’ where 1 = 1 and active_id = ‘16394ad531f1d6a5’;
获取列表数据:select * from ‘数据库名称’ limit
select * from active limit 0, 10;
模糊查询:keyword like ‘%1%’
select * from active where 1 = 1 and keyword like ‘%1%’
模糊查询高性能方法:LOCATE(’’,关键字)
select * from active where 1 = 1 and LOCATE(’’,keyword) ORDER BY img_time DESC limit 0, 10
按时间排序:ORDER BY
asc是指定列按升序排列,desc则是指定列按降序排列。
select * from active where 1 = 1 and keyword like ‘%%’ ORDER BY img_time DESC limit 0, 10
select * from active where 1 = 1 and keyword like ‘%%’ ORDER BY img_time ASC limit 0, 10
获取总条数:count()
select count() as count from active where 1 = 1
————————————————
版权声明:本文为CSDN博主「时间飞逝子非鱼」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/lgysjfs/article/details/100077636
边栏推荐
- Blue screen error UNMOUNTABLE boot volume of the solution
- Introduction to data platform
- 一文讲透,商业智能BI未来发展趋势如何
- The pie chart with dimension lines can set various parameter options
- À propos de ETL il suffit de lire cet article, trois minutes pour vous faire comprendre ce qu'est ETL
- Send custom events in QT
- PHP代码加密+扩展解密实战
- Three ways to uninstall Symantec Endpoint Protection Symantec
- Pymysql inserts data into MySQL and reports an error for no reason
- Xiaohei ai4code code baseline nibble 1
猜你喜欢
随机推荐
Building a static website with eleventy
How to replace the web player easyplayerproactivex Key in OCX?
【生活思考】计划与自律
表单图片上传在Chorme中无法查看请求体的二进制图片信息
rsync做文件备份
【关于运维和网工的差别,一文说透】
Send custom events in QT
何时使用RDD和DataFrame/DataSet
[explain the difference between operation and maintenance and network engineering]
Get screen width and height tool class
疫情、失业,2022,我们高喊着摆烂和躺平!
Using skills of xargs -- the way to build a dream
The reason why the qtimer timer does not work
liunx服务器 telnet 带用户名 端口登陆方法
String to Base64
Redis的Cluster集群数据倾斜
Why do you want to file? What are the advantages and disadvantages of website filing?
小黑ai4code代码baseline啃食1
ZUCC_编译语言原理与编译_实验06 07 语法分析 LL 分析
第七章 操作位和位串(三)







