Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- with email_delpoints as
- (select email_from, delivery_point_id, create_date lead_date
- from (
- select email_from, delivery_point_id, create_date, rank() over (partition by email_from order by create_date desc) as rnk
- from email e
- where e.create_date >= '01-MAR-2017'
- --and e.create_date < '01-APR-2017'
- and e.email_type_id = 6
- and e.sec_user_login_source_id in (1,4)
- and e.delivery_point_id is not null) sub where rnk = 1)
- select *
- from email_delpoints ed;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement