转换相关的子请求加入? [英] Convert correlated subqery to join?

查看:71
本文介绍了转换相关的子请求加入?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个查询,通过相关子查询执行自连接。我希望能够从这一行中选择。或者基于rn的此行之前的最后一行。列,其中填充了column1。它目前使用相关子查询工作如下:

I have a query that does a self join following by correlated subquery. I want to be able to select from "this row" or the latest row before "this row", based on the "rn" column, where column1 is populated. Its currently working using a correlated subquery as follows:

展开 | 选择 | Wrap | 行号

推荐答案

也许它可能如果你用文字描述,你会更容易理解你在寻找什么。
Perhaps it may be easier to understand what you''re looking for if you described it in words.


好的,我在第一个例子中使用了样本表/列。场景是我有一个项目随时间变化的表,基本上是ID,priceChange和计算的行号。有些项目可能在特定月份内没有变化,因此我遇到的情况是我最终得到的表格如
OK, I used sample tables/columns in first example. There scenario is I have a table of item changes over time, basically ID, priceChange and a calculated row number. Some items may not change in a particular month and so I have a situation where I end up with a table like
展开 | 选择 | Wrap | 行号


是。当然。


试试这个:

Yes. Certainly.

Try this :

展开 | 选择 | Wrap | 行号


这篇关于转换相关的子请求加入?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆