Guest User

Untitled

a guest
Nov 22nd, 2017
676
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. o_id o_c_id o_type o_date
  2. 1345 2145 TA 2015-01-01
  3. 7499 2145 TA 2015-01-16
  4. 7521 2146 GA 2015-01-08
  5. 7566 2146 TA 2016-01-24
  6. 7654 2147 FB 2016-01-28
  7.  
  8. c_id c_name c_email
  9. 13 Anderson [email protected]
  10.  
  11. select c.id, c.name, count(*) as counts, year(o.date)
  12. from orders o
  13. join customer c on o.c_id=c.id
  14. where year(o.date) > 2009
  15. group oy c.id
  16. having count(*) > 7
Add Comment
Please, Sign In to add comment