有人给了我一个SQL问题,让我难住了,我想知道是否有人能告诉我最好的方法。
问题:给定表"product_price"表示产品在一段时间内的平均价格。范围内的所有天数都出现在"day"中。
价格($)
看起来下面应该会给你想要的结果:
with s as (
select *,
Lag(Price, 1, Price) over(order by day) p,
Lead(Price, 1, Price) over(order by day) n
from prices
)
select day
from s
where p < Price and n < Price;
相关内容
- Hazelcast类在EntryExpiredListener上没有发现异常
- clickhouse create table异常:在查询中发现聚合函数minState(origin_user)在错误
- NoBean发现异常
- 仅在IIS中未发现asp.net core的部分视图异常
- 提供程序未发现异常 (错误:<EntryProvider>在此主页小部件上方找不到正确的提供程序
- 处理返回HasElement()为True但未发现异常的bloomberg Blpapi元素
- 文件在从路径编码图像时未发现异常
- Hibernate-Entity未发现异常-Spring批处理
- 提供程序未发现异常(错误:在此<GroupModel> GroupScreen 小部件上方找不到正确的提供程序
- 没有为类找到序列化器,没有发现创建BeanSerializer的属性(为了避免异常,禁用serializationfea
- Laravel - InvalidArgumentException视图未发现异常
- 资源未发现ShapeableImageView使用矢量异常?
- 发现产品价格异常
- 无法在docker中运行jmeter测试,获取类未发现异常
- 在kibana发现时没有分片可用操作异常
- 在java扫描器中没有发现异常
- 找到数据库异常:发现名称的冲突获取器:isImportantForAccessibility
- r语言 - 以下错误是什么意思:拓扑异常:发现线串之间的非非非非交集
- 吉廷异常发现没有.使用 Apache poi 的 xlsx 文件中的工作表
- 项目特定的套接字异常:发现死网络
最新更新
- 使段落出现,并使其在点击显示下一个段落时消失
- GROUP_CONCAT(DISTINCT xxx)将连接值的顺序颠倒
- r语言 - 循环遍历列表的列表
- 如何使用Pandas数据框架将R代码语法转换为Python语法?
- 当我运行服务器我得到这个错误:Django 405错误
- 如何将列表中的每个数字与另一个列表中的每个数字相乘
- 用其他字典中的值替换字典中值列表中的元素
- super() 不能递增父类的类变量,但它会更新父类的类字典
- Java中的冗余赋值vs赋值前检查
- 输入数据量变化;需要的建议
- 根据键合并两个数组,并使用mongo聚合添加新字段
- 显示头表,从数组的子列- Angular
- 如何上传AppendBlob/一个大于4mb限制的文件到Azure存储/Blob在Java?
- client_loop: send disconnect:长时间运行jenkins管道时管道破裂问题
- 使用 python 跟踪游戏不断更新的日志文件的最佳方法是什么?
- Gsutil 错误"Caught socket error, retrying: timed out "
- 如何在<h3>相同的高度制作
- #address 单元的 DTC 编译错误 = <2> 大小写
- 遵循Flutter web的重定向url
- 从数据库中获取值作为表
- 我们可以通过在一个应用程序中拥有更多(比用户机器上其他运行的应用程序)线程/进程来窃取更多的CPU时间/资源吗?<
- 如何在vue js中基于数组唯一id的选择选项中显示数据
- React中的 useRef语法
- 如何在react native图像滑动框中更改图像大小
- 绘制函数CustomPaint和PictureRecorder以不同的大小工作
- docker 无法连接到 docker 守护程序,但已创建套接字
- 无法解析Java程序中的@param注释
- 在互斥锁上使用多个std::unique_lock,所有线程在FIFO等待进程?
- Command error out with exit status 1: python setup.py egg_in
- 当NPM应用在子文件夹中时,NPM版本命令不创建git标签
热门标签:
javascript python java c# php android html jquery c++ css ios sql mysql arrays asp.net json python-3.x ruby-on-rails .net sql-server django objective-c excel regex ruby linux ajax iphone xml vba spring asp.net-mvc database wordpress string postgresql wpf windows xcode bash git oracle list vb.net multithreading eclipse algorithm macos powershell visual-studio image forms numpy scala function api selenium