Subject | Re: [firebird-support] Skip records |
---|---|
Author | Svein Erling Tysvær |
Post date | 2014-07-29T19:34:18Z |
>> Don't know whether windowing functions can be used in the WHERE clause, but when Firebird 3 is released, it would be tempting to try things likeThanks for confirming things to work more like I expected them to, rather than what I hoped. Anyway, adding a CTE is only a minor overhead.
>>
>> WHERE MOD(ROW_NUMBER() OVER (ORDER BY <something>), 5) = 2
>
>You shouldn't be able to use window functions in a `WHERE`, only in the
>`SELECT` columnlist. The `ROW_NUMBER` is applied over the materialized
>rows, so you can't apply it in the filtering condition. You need a
>subquery or CTE with `ROW_NUMBER()` and then filter that in the outer
>select.
Set