当前位置:网站首页>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
边栏推荐
- How to improve the customer retention rate in the operation of independent stations? Customer segmentation is very important!
- 利用sonar做代码检查
- 何时使用RDD和DataFrame/DataSet
- Using sonar for code checking
- 小黑ai4code代码baseline啃食1
- Common date formatter and QT method for obtaining current time
- 【力扣10天SQL入门】Day3
- Smart power plant: how to make use of easycvr to build a safe, stable, green and environment-friendly intelligent inspection platform
- xargs使用技巧 —— 筑梦之路
- 数据库,查询本月借出书的数量,如果高于10本时,显示“本月借出书大于10本”,否则显示“本月借出书小于10本”
猜你喜欢

原生小程序用画布制作海报,等比例缩放,和uniapp差不多就是写法有点不同

JUC personal simple notes

rpiplay实现树莓派AirPlay投屏器

ZUCC_ Principles of compiling language and compilation_ Experiment 01 language analysis and introduction

Send custom events in QT

分布式 | 如何与 DBLE 进行“秘密通话”

It is enough to read this article about ETL. Three minutes will let you understand what ETL is

OpenCV to realize the basic transformation of image

liunx服务器 telnet 带用户名 端口登陆方法

数据库迁移从PostgreSQL迁移到 MYSQL
随机推荐
leetcode 1268. Search suggestions system
利用sonar做代码检查
Mysql数据(Liunx环境)定时备份
数据平台简介
Shell pass parameters
leetcode 1642. Furthest Building You Can Reach(能到达的最远的建筑)
Rust procedure macro simply imitates Lombok function
为什么ping不通,而traceroute却可以通
Use cpulimit to free up your CPU
Lombok use
orb slam build bug: undefined reference to symbol ‘_ ZN5boost6system15system_ categoryEv‘
提高INSERT速度
Easydss anonymous live channel data volume instability optimization scheme sharing
ZUCC_ Principles of compiling language and compilation_ Experiment 0607 grammar analysis ll analysis
一文讲透,商业智能BI未来发展趋势如何
何时使用RDD和DataFrame/DataSet
Qt源码分析--QObject(2)
What is the future development trend of Business Intelligence BI
There was an error checking the latest version of pip
There was an error checking the latest version of pip