- 博客(19)
- 资源 (1)
- 收藏
- 关注
转载 SQL 查找某列连续的几个值是否相同
我有一个table类似下面name item value rectimeA 001 0.98 2013/7/24 12:12:30A 002 0.98 2013/7/23 09:06:50A 002 0.95 2013/7/23 08:00:00B 004 0.95 2013/7/24 10:10:30B 00...
2019-08-15 11:42:13
1347
转载 SAP HANA grouping sets
原文链接:https://my.oschina.net/corleone/blog/1315762019独角兽企业重金招聘Python工程师标准>>> hot3.png本文只是对SAP HANA SQL Reference Manual 中关于group by的部分做一些个人解释。数据准备:create column table t1 ( id int primary ...
2019-07-22 20:18:14
1158
转载 一文读懂Hive分析窗口函数(hive做累计、分组、排序、层次等计算)
转载:https://blog.youkuaiyun.com/abc200941410128/article/details/78408942#分析窗口函数应用场景:(1)用于分区排序(2)动态Group By(3)Top N(4)累计计算(5)层次查询Hive中提供了越来越多的分析函数,用于完成负责的统计分析。大致可以分为以下四类:Hive分析窗口函数(一) SUM,AVG,MIN,MAX...
2019-07-22 19:51:19
2330
转载 [Oracle]Lead和Lag偏移量函数使用详解
数据库学习网站 https://www.itkc8.comOracle有两个函数:LEAD和LAG,这两个函数都是用来计算偏移量的分析函数,这两个函数的用法相同。Oracle官方文档解释是:LEAD is an analytic function. It provides access to more than one row of a table at the same time with...
2019-06-22 17:19:41
1391
原创 BW/4 HANA -HANA引用BW 的DSO外部视图-字段不存在的问题
DSO外部视图:HANA读取DSO遇到字段不存在的问题在HANA中想读取这个DSO的数据来SQL建模,用SELECT * FROM TABLE,是不会报错但是!读取部分字段时报以下错误:或解决方法:可能是因为HANA识别不了字段中的特殊字符,在你需要读取的字段上加上双引号,就可以解决这个问题。以后遇到类似的问题,可以首先试着给字段加上双引号。...
2018-11-23 10:36:19
984
转载 开窗函数over(partition by .. [order by ..])用法
作者:tang_xuming来源:优快云原文:https://blog.youkuaiyun.com/tang_xuming/article/details/79197163版权声明:本文为博主原创文章,转载请附上博文链接!1、/** 创建表 /create table test_orer_partition_by(prov_name varchar(20),city_name varch...
2018-11-22 17:05:52
1416
原创 HANA-sum函数与sum() over(partition by ... order by ... )
sum函数与sum() over(partition by … order by … )sum()函数就不介绍了。sum() over(partition by … order by … )其实就是累加的过程具体化。比如 有1,2,3,4sum()就会得到10sum() over(partition by … order by … ) 就会得到:1,3,6,10。例子:...
2018-11-22 16:58:15
5000
原创 LeetCode刷题笔记 - 185.Department Top Three Salary
2018-10-30185.Department Top Three Salaries文章目录185.Department Top Three Salaries一、Description:二、Solution:解法一:解法二:解法三:解法四:三、总结知识点:1、ALTER、UPDATE语法一、Description:The Employee table holds all employee...
2018-11-02 15:30:26
275
原创 LeetCode刷题笔记 - 184.Department Highest Salary
2018-10-30184.Department Highest Salary文章目录184.Department Highest Salary一、Description:二、Solution:解法一:解法二:解法三:三、总结知识点:1、ALTER、UPDATE语法一、Description:The Employee table holds all employees. Every emp...
2018-10-31 20:41:58
263
原创 HANA SQL - RANK函数
2018-10-31HANA SQL - RANK函数文章目录HANA SQL - RANK函数rank函数问题:解法:==**rank在sqlscript中使用场景**====**RANK()使用图形计算视图**==rank函数问题:表:employee找出表中不同departmenid里salary最高的人员信息,筛选结果如下解法:select name,salary,dep...
2018-10-31 12:41:09
4233
原创 LeetCode刷题笔记 - 183. Customers Who Never Order
2018-10-30183.Customers Who Never Order文章目录183.Customers Who Never Order一、Description:二、Solution:解法一:解法二:解法三:三、总结知识点:1、NOT IN2、IS NULL3、NOT EXISTS一、Description:Suppose that a website contains two ...
2018-10-30 15:48:10
196
原创 LeetCode刷题笔记 - 182. Duplicate Emails
2018-10-22182.Duplicate Emails文章目录182.Duplicate Emails一、Description:二、Solution:解法一:解法二:三、总结知识点:1、过滤数据:Where子句(1)、WHERE子句操作符a、检查单个值b、 不匹配检查c、 范围值检查d、 空值检查(2)、高级数据过滤-组合 WHERE 子句a、 AND 操作符b、 OR操作符2、Gro...
2018-10-29 17:51:52
404
原创 LeetCode刷题笔记 - 181. Employee Earning More Than Their Managers
2018-10-22181.Employee Earning More Than Their Managers文章目录181.Employee Earning More Than Their Managers一、Description:二、Solution:解法一:解法二:一、Description:The Employee table holds all employees includ...
2018-10-22 14:03:51
399
原创 LeetCode刷题笔记 - 178. Rank Scores
2018-10-17178.Rank Scores文章目录178.Rank Scores一、Description:二、Solution:解法一:解法二:解法三:解法三:解法四:一、Description:Write a SQL query to rank scores. If there is a tie between two scores, both should have the ...
2018-10-22 11:02:42
249
原创 LeetCode刷题笔记 - 180. Consecutive Numbers
2018-10-22180.Rank Scores文章目录180.Rank Scores一、Description:二、Solution:解法一:解法二:一、Description:Write a SQL query to find all numbers that appear at least three times consecutively.+----+-----+| Id |...
2018-10-22 11:02:31
185
原创 LeetCode刷题笔记 - 177. Nth Highest Salary
2018-10-11177. Nth Highest Salary一、Description:Write a SQL query to get the nth highest salary from the Employee table.+----+--------+| Id | Salary |+----+--------+| 1 | 100 || 2 | 200 ...
2018-10-17 10:59:37
475
原创 LeetCode刷题笔记 - 176.Second Highest Salary
2018-10-10176.Second Highest SalaryWrite a SQL query to get the second highest salary from the Employee table.±—±-------+| Id | Salary |±—±-------+| 1 | 100 || 2 | 200 || 3 | 300 |...
2018-10-10 20:12:19
491
原创 LeetCode刷题笔记 - 175.Combine Two Tables
2018-10-09在LeetCode上刷MySQL数据库的题。以下序号与LeetCode上的题目序号保持一致,方便以后自己查看。根据每道题考察的内容,来扩展知识点。每天记录刷题内容、笔记、心得。目录175.Combine Two TablesDescription:Solution:总结:(1)inner join 内联结(等值联结):(2)out...
2018-10-09 18:02:30
318
转载 HANA 日期函数
如何在HANA中获取当前日期,以及日期格式转换语句语句:select current_date from dummy; ---获取当前日期select to_date(CURRENT_DATE )from dummy; ---to_date:转换为日期格式V_ZDATA := to_date(CURRENT_DATE); ---存储过程中给标量变量赋值当前日期V_ZDA...
2018-05-31 10:34:11
25265
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人