摘要:
之前会纠结,12月份有没有31号这样,直接用小于下一年的1月1号就可以了!!! 条件中where time>'2020-01-01' AND time <'2021-01-01' year(b.order_date) = '2020' 这样写也可以!!! 阅读全文
posted @ 2022-12-04 21:43
yinghualeihenmei
阅读(60)
评论(0)
推荐(0)
摘要:
https://leetcode.cn/problems/game-play-analysis-i/submissions/ Activity 表:+ + + + +| player_id | device_id | event_date | games_played |+ + + + +| 1 | 阅读全文
posted @ 2022-12-04 21:33
yinghualeihenmei
阅读(65)
评论(0)
推荐(0)
摘要:
SQL——EXISTS用法 原文链接:http://www.manongjc.com/detail/26-vnlqolqounrrkqi.html 如下:表AID NAME 1 A12 A23 A3表BID AID NAME1 1 B12 2 B2 3 2 B3表A和表B是1对多的关系 A.ID = 阅读全文
posted @ 2022-12-04 17:08
yinghualeihenmei
阅读(181)
评论(0)
推荐(0)
摘要:
https://www.cnblogs.com/shuilangyizu/p/6296440.html DATEDIFF 函数 [日期和时间] 功能 返回两个日期之间的间隔。 语法 DATEDIFF ( date-part, date-expression-1, date-expression-2 阅读全文
posted @ 2022-12-04 00:20
yinghualeihenmei
阅读(477)
评论(0)
推荐(0)
摘要:
https://blog.csdn.net/qq_51179608/article/details/124322292 实际上,每个web应用程序和数据库都扮演着重要的角色。由于当前web开发的动态特性,即使是最基本的应用程序也需要某种存储、检索和修改数据的机制。自然,随着数据库的重要性的飙升,某些 阅读全文
posted @ 2022-12-03 22:06
yinghualeihenmei
阅读(966)
评论(0)
推荐(0)
摘要:
要想获取第二高,需要排序,使用 order by(默认是升序 asc,即从小到大),若想降序则使用关键字 desc 去重,如果有多个相同的数据,使用关键字 distinct 去重 判断临界输出,如果不存在第二高的薪水,查询应返回 null,使用 ifNull(查询,null)方法 起别名,使用关键字 阅读全文
posted @ 2022-12-03 22:06
yinghualeihenmei
阅读(79)
评论(0)
推荐(0)
摘要:
https://blog.csdn.net/tswc_byy/article/details/81909822 二、having的用法1.解释:having子句是用来对分组之后的信息进行过滤,因此使用having时通常都会先使用group by。 select deptno,avg(sal) fro 阅读全文
posted @ 2022-12-03 21:35
yinghualeihenmei
阅读(1405)
评论(0)
推荐(0)
摘要:
题目: https://leetcode.cn/problems/tree-node/ 给定一个表 tree,id 是树节点的编号, p_id 是它父节点的 id 。 + + +| id | p_id |+ + +| 1 | null || 2 | 1 || 3 | 1 || 4 | 2 || 5 阅读全文
posted @ 2022-12-03 21:00
yinghualeihenmei
阅读(75)
评论(0)
推荐(0)
摘要:
https://mp.weixin.qq.com/s?src=11×tamp=1670070823&ver=4204&signature=OpXckzt0JIEqamYo0WpJqwgtbQDMFkUpQ0Nc56WLqzHq0bMR91TRHbCxycSCx49JmQNO9K7MCZ-X 阅读全文
posted @ 2022-12-03 20:36
yinghualeihenmei
阅读(1844)
评论(0)
推荐(0)
摘要:
文章来源:https://leetcode.cn/problems/rearrange-products-table/solution/by-esqiimulme-pjiy/ 列转行用union或union all将多列的字段整合到一行。(当使用union 时,mysql 会把结果集中重复的记录删掉 阅读全文
posted @ 2022-12-03 20:25
yinghualeihenmei
阅读(1906)
评论(0)
推荐(0)
浙公网安备 33010602011771号