当前位置:网站首页>[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 );
边栏推荐
- Deep learning: numpy
- 品达通用权限系统(Day 1~Day 2)
- ROS的发布消息Publishers和订阅消息Subscribers
- Idea collection code, quickly open favorites collection window
- wm_ Concat() and group_ Concat() function
- Yujun product methodology
- Résumé des points de connaissance
- In and exceptions, count (*) query optimization
- 微服务版单点登陆系统(SSO)
- MySQL download and configuration MySQL remote control
猜你喜欢

Numpy's Matplotlib

When does the mobile phone video roll off?

VCD-影音光碟

Image binarization

Vscode 基础必备 常用插件

Wechat applet custom pop-up components

(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

stm32和电机开发(直流有刷电机和步进电机)

品达通用权限系统(Day 3~Day 4)

微信小程序 uniapp 左滑 删除 带删除icon
随机推荐
Vscode 基础必备 常用插件
Paging query and join Association query optimization
一些基本错误
刻录光盘的程序步骤
微信小程序 uniapp 左滑 删除 带删除icon
手机影像内卷几时休?
Pinda general permission system (day 3~day 4)
CLion断点单步调试
Clion compiling catkin_ WS (short for ROS workspace package) loads cmakelists Txt problems
Summary of alter operation in SQL
Eigen库计算两个向量夹角
微信小程序 自定义 弹框组件
Microservice architecture
ROS查询话题具体内容常用指令
vuex中利用缓存解决刷新state数据丢失问题
Wechat applet custom pop-up components
转:实事求是
成功解决之微服务@Value获取配置文件乱码问题
IK word breaker
最小生成树、最短路径、拓扑排序、关键路径