当前位置:网站首页>[MySQL series] collection of common working SQL (continuous update)
[MySQL series] collection of common working SQL (continuous update)
2022-06-26 18:42:00 【JobsTribe】
Summarize the commonly used sql.
Get the current time in milliseconds
be used CURRENT_TIMESTAMP(3).
select CURRENT_TIMESTAMP(3);
However, when specifying fields, you need to note that the field type also needs to datatime(3) type .
In the field type ,datetime(3) It is accurate to the millisecond level ,datetime The default is 0, Accurate to the second level .
How to count the total number of interface calls ?
use group by, Such as
SELECT
service,
app_key,
count(*)
FROM
trace_log t
WHERE
create_time BETWEEN '2020-04-01 00:00'
AND '2020-05-01 00:00'
GROUP BY
service,
app_key;
The number of entries in the statistical table exceeds 2 Data for
With aggregate functions having
SELECT
service,
app_key
FROM
aa
GROUP BY
service
HAVING
count( * ) > 1;
Query second place
Use the less than sign , This will rule out null
SELECT
max( VALUE )
FROM
customer
WHERE
VALUE
< ( SELECT max( VALUE ) FROM customer );
边栏推荐
- 品达通用权限系统(Day 3~Day 4)
- 微服务版单点登陆系统(SSO)
- Create a time blocker yourself
- CLion断点单步调试
- Clion compiling catkin_ WS (short for ROS workspace package) loads cmakelists Txt problems
- Publish message publishers and subscribe message subscribers of ROS
- PC端录制扫515地机器人/scan数据
- PC end records 515 ground sweeping robot /scan data
- 为什么我不推荐去SAP培训机构参加培训?
- (multi threading knowledge points that must be mastered) understand threads, create threads, common methods and properties of using threads, and the meaning of thread state and state transition
猜你喜欢

Preliminary analysis of serial port printing and stack for arm bare board debugging

Project practice 4: user login and token access verification (reids+jwt)

最小生成树、最短路径、拓扑排序、关键路径

(multi threading knowledge points that must be mastered) understand threads, create threads, common methods and properties of using threads, and the meaning of thread state and state transition

LeetCode 面试题29 顺时针打印矩阵

深度学习之Numpy篇

Vscode 基础必备 常用插件

Redis单点登陆系统+投票系统

品达通用权限系统(Day 1~Day 2)

Filebeat安装及使用
随机推荐
品达通用权限系统(Day 3~Day 4)
Clion编译catkin_ws(ROS工作空间包的简称)加载CMakeLists.txt出现的问题
NFTGameFi链游系统开发详解方案丨链游系统开发原理解析
Wechat applet custom pop-up components
Redis Basics
PC端录制扫515地机器人/scan数据
Development principle analysis and source code of dapp-lp single and dual currency liquidity pledge mining system
Some basic mistakes
Do you know how to compare two objects
刻录光盘的程序步骤
交叉编译环境出现.so链接文件找不到问题
商品秒杀系统
Pinda general permission system (day 1~day 2)
微信小程序 uniapp 左滑 删除 带删除icon
JVM入個門(1)
问题解决:虚拟机无法复制粘贴文件
Comparing the size relationship between two objects turns out to be so fancy
Map and list < map > transfer to corresponding objects
CD-CompactDisk
Enter n integers and output the number of occurrences greater than or equal to half the length of the array