SHARE
TWEET

Untitled

a guest Jun 18th, 2019 68 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. select
  2.   concat(10*floor(age/10), '-', 10*floor(age/10) + 10) as `range`,
  3.   count(*) as count
  4. from (
  5.   select
  6.     TIMESTAMPDIFF(YEAR, customers.birthdate, CURRENT_DATE()) AS age
  7.   from
  8.     customers inner join vehicles on customers.id = vehicles.customer_id
  9.    where
  10.     customers.birthdate IS NOT NULL
  11.     AND vehicles.branch_code = 'H360'
  12. ) as t
  13. group by `range`
  14. ORDER BY `range`
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top