Guest User

Untitled

a guest
Feb 16th, 2019
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. CREATE VIEW rep_lls_assign_agent_to_be_added as (
  2. SELECT
  3. act.ap_id "id",
  4. act.agent_name "agent_name",
  5. act.market "market",
  6. date(min(act.saved_at)) as "assign_date"
  7.  
  8. FROM prod_reporting_ops.rep_ops_lls_ACTIVITIES AS act
  9. LEFT JOIN prod_reporting_ops.rep_lls_assign_agent as ap
  10. ON ap.id = act.ap_id
  11.  
  12. WHERE
  13. act.saved_at >= "2019-02-07"
  14. and ap.id IS NULL
  15. and act.ap_id <> ""
  16. and act.ap_id NOT LIKE '%/%'
  17. group by act.ap_id);
Add Comment
Please, Sign In to add comment