Skip to content
Advertisement

How to filter within a Window Function PostgreSQL

I only want to filter in Window function to keep the created_at is null so I don’t use WHERE clause previously. Because when I order by created_at desc it will show the null value first.

How to add a filter in this code?

I try this not work:

Advertisement

Answer

You can sort the NULL values to the end:

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement