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

c++ - Creating new partition disk winapi -

Android Prevent Bluetooth Pairing Dialog -

VBA function to include CDATA -