![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
MySQL
文章平均质量分 58
Jessica_FM
这个作者很懒,什么都没留下…
展开
-
【MySQL】Leetcode刷题--数据库(MySQL)常用的函数及语法
Leetcode数据库(MySQL)常用的函数日期函数datediff字符串操作trim(), ltrim(), rtrim()lower()和upper()合理的创建标题,有助于目录的生成如何改变文本的样式插入链接与图片如何插入一段漂亮的代码片生成一个适合你的列表创建一个表格设定内容居中、居左、居右SmartyPants创建一个自定义列表如何创建一个注脚注释也是必不可少的KaTeX数学公式新的甘特图功能,丰富你的文章UML 图表FLowchart流程图导出与导入导出导入日期函数datediffMyS原创 2022-04-06 17:47:11 · 349 阅读 · 0 评论 -
【Leetcode-SQL196】删除重复的电子邮箱
Leetcode 196. 删除重复的电子邮箱参考代码对delete和>的解释题目描述参考代码delete p1from Person p1 join Person p2on p1.Email = p2.Email and p1.Id >p2.Id对delete和>的解释如下内容转载自LeetCode,仅供个人学习记录1、 DELETE p1在Delete官方文档中,给出了这一用法,比如下面这个DELETE语句DELETE t1 FROM t1 LEFT JOIN原创 2022-01-27 22:08:31 · 116 阅读 · 0 评论 -
【Leetcode-SQL1435】制作会话柱状图
Leetcode 1435. 制作会话柱状图易错点参考答案题目描述易错点selectbin,count(1) as totalfrom ( select case when duration/60 >=0 and duration/60 <5 then '[0-5>' when duration/60 >=5 and duration/60 <10 then '[5-10>' when duration/60 >原创 2022-01-13 23:31:54 · 129 阅读 · 0 评论 -
【Leetcode-SQL1264】页面推荐
Leetcode 1264. 页面推荐易错点参考答案题目描述易错点select distinct page_id as recommended_pagefrom Likeswhere user_id in( select user2_id from Friendship where user1_id = 1 union select user1_id from Friendship where user2_id = 1)原创 2022-01-11 22:02:00 · 86 阅读 · 0 评论 -
【Leetcode-SQL1076】项目员工II
Leetcode 1076. 项目员工II易错点参考答案一参考答案二题目描述易错点雇佣最多的项目可能不止有一个,可能会存在相同雇员数量的项目;容易写成如下错误代码:select project_idfrom Projectgroup by project_idorder by count(1) desclimit 1;参考答案一select project_idfrom Projectgroup by project_idhaving count(*) = (select原创 2021-12-24 04:30:11 · 3325 阅读 · 0 评论 -
【MySQL】MySQL保留小数的操作(format, truncate, round)
MySQL保留小数的操作(format, truncate, round)format(x, y)truncate(x, y)round(x, y)format(x, y)format(x, y) 会进行四舍五入操作,满三位会加逗号进行分割,返回的类型是字符串类型truncate(x, y)truncate(x, y) 不会进行四舍五入操作,直接截取。round(x, y)round(x, y) 会进行四舍五入,stackOverFlow中的例子...原创 2021-12-24 01:27:44 · 904 阅读 · 0 评论