当前位置:网站首页>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
边栏推荐
- Increase insert speed
- rpiplay实现树莓派AirPlay投屏器
- "Adobe international certification" Photoshop software, about drawing tutorial?
- JS to get the last element of the array
- 什么是SRE?一文详解SRE运维体系
- Using ngrok for intranet penetration
- api平台通用签名机制
- Battle history between redis and me under billion level traffic
- OpenCV to realize the basic transformation of image
- QT writing security video monitoring system 36 onvif continuous movement
猜你喜欢
![打印出来的对象是[object object],解决方法](/img/fc/9199e26b827a1c6304fcd250f2301e.png)
打印出来的对象是[object object],解决方法

ZUCC_ Principles of compiling language and compilation_ Experiment 0607 grammar analysis ll analysis

成为IEEE学生会员

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

ZUCC_ Principles of compiling language and compilation_ Experiment 04 language and grammar

uniapp 热更新后台管理

MySQL 因字符集问题插入中文数据时提示代码 :1366

Redis cluster data skew

ZUCC_编译语言原理与编译_实验06 07 语法分析 LL 分析

数据库迁移从PostgreSQL迁移到 MYSQL
随机推荐
2020中国全国各省市,三级联动数据,数据机构(数据来自国家统计局官网)
小程序云数据,数据请求一个集合数据的方法
Win10 cloud, add Vietnamese
ZUCC_ Principles of compiling language and compilation_ Experiment 0607 grammar analysis ll analysis
[untitled]
There was an error checking the latest version of pip
Variable declaration and some special variables in shell
Smart power plant: how to make use of easycvr to build a safe, stable, green and environment-friendly intelligent inspection platform
小黑ai4code代码baseline啃食1
2022.06.23(LC_144,94,145_二叉树的前序、中序、后序遍历)
Jenkins自动化部署,连接不到所依赖的服务【已解决】
Using skills of xargs -- the way to build a dream
数据平台简介
饼状统计图,带有标注线,都可以自行设定其多种参数选项
利用sonar做代码检查
单目双视三维坐标确定
【生活思考】计划与自律
Send custom events in QT
xtrabackup做数据备份
K8s deployment of highly available PostgreSQL Cluster -- the road to building a dream