Advertisement
Guest User

kur2

a guest
Dec 15th, 2019
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.31 KB | None | 0 0
  1. use plant_service;
  2. select concat(u.first_name," ",u.last_name) as first_name,u.username,c.name as city,year(u.register_date) as register_year from users as u
  3. join cities as c on u.city_id=c.id
  4. where((first_name is not null) and u.id not in (select orders.user_id from orders))
  5. order by register_year asc,first_name asc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement