sql - Use analytic function result in where clouse -


i got statement:

select ar.*, lag(dest_time, 1) on (order fep_id) hit  dsyy.archiv ar; 

it works pretty fine. want that:

select ar.*,     lag(dest_time, 1) on (order fep_id) hit      dsyy.archiv ar      arr_time < hit; 

unfortunality not allowed... tell me how can deal column hit inside where-clouse?

thx lot

simply use subquery:

select ar.* (select ar.*,              lag(dest_time, 1) on (order fep_id) hit        dsyy.archiv ar       ) ar arr_time < hit; 

Comments

Popular posts from this blog

basic authentication with http post params android -

vb.net - Virtual Keyboard commands -

css - Firefox for ubuntu renders wrong colors -