Database
洛yu
数据分析行业,编程小白,主要用R,Python,博客纯粹为了记录自己的学习笔记
展开
-
#Mysql# Leetcode 534. Game Play Analysis III
#Leetcode# 534. Game Play Analysis III关于running total的用法https://www.mysqltutorial.org/mysql-window-functions/https://www.wagonhq.com/blog/running-totals-sql/https://codingsight.com/calculating-running-total-with-over-clause-and-partition-by-clause-in-s原创 2021-05-06 12:03:32 · 125 阅读 · 0 评论 -
#Mysql# Leetcode 176
#Leetcode 176Write a SQL query to get the second highest salary from theEmployeetable.SELECT IFNULL((SELECT DISTINCT salaryfrom EmployeeOrder by Salary DESClimit 1 offset 1),NULL)AS SecondHighestSalaryhttps://www.cnblogs.com/dongml/p/1095...原创 2021-05-05 11:47:58 · 85 阅读 · 0 评论 -
SQL Server - PIVOT用法
https://docs.microsoft.com/en-us/sql/t-sql/queries/from-using-pivot-and-unpivot?view=sql-server-ver15SELECT <non-pivoted column>, [first pivoted column] AS <column name>, [second pivoted column] AS <column name>, ...原创 2020-12-03 04:05:00 · 525 阅读 · 0 评论 -
MySQL - LAG()与LEAD()函数的用法
每天学一个mysql的新知识,记录下。参考帖子:讲的很详细了https://www.begtut.com/mysql/mysql-lead-function.htmlhttps://www.begtut.com/mysql/mysql-lag-function.htmlLAG()函数 与 LEAD()函数LAG()函数 :允许您回顾多行并从当前行访问行的数据。LAG()语法:LAG(<expression>[,offset[, default_value]..原创 2020-11-17 15:12:38 · 998 阅读 · 0 评论