Advertisement
zachdyer

Left Join 3 tables

May 10th, 2020
1,271
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SQL 0.27 KB | None | 0 0
  1. SELECT users.username, companies.company, stores.store, stores.address, stores.city, stores.state, stores.zip
  2. FROM users
  3. LEFT JOIN stores
  4. ON users.store_id = stores.id
  5. LEFT JOIN companies
  6. ON companies.id = stores.company_id
  7. WHERE companies.id = 1
  8. ORDER BY stores.store;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement