I have 2 tables: "users" and "pages".
I need to list table "users" but IF user have own pages to first display users who have "pages" and after that to list others who don't have "pages".
USERS table:
id | name | lastname
PAGES table:
id | user_id | content
I don't know how to write query for this.
Thanks!