Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for LEAD() / LAG() with Row[N] arguments #3188

Closed
lukaseder opened this issue Apr 16, 2014 · 2 comments
Closed

Add support for LEAD() / LAG() with Row[N] arguments #3188

lukaseder opened this issue Apr 16, 2014 · 2 comments

Comments

@lukaseder
Copy link
Member

As can be seen in this blog post, PostgreSQL allows for ROW types to be passed to LEAD() and LAG() window functions:
http://blog.jooq.org/2014/04/15/how-to-do-this-with-sql-of-course/

Example:

with data
as (
  select 
    row(sektor, row, scene1, scene2) block
  from d
)
select 
  case 
    when lag (block) over(o) is distinct from block 
     and lead(block) over(o) is distinct from block 

It's probably not possible to emulate this in other databases, if it isn't natively supported.

@lukaseder
Copy link
Member Author

This depends on #3889

@lukaseder
Copy link
Member Author

See also: #11998

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant