Advertisement
Guest User

Untitled

a guest
May 21st, 2018
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MySQL 0.57 KB | None | 0 0
  1. SELECT orderId, c.firstname, c.secondname, concat(a.street,\' \',a.city,\' \',a.postcode) as adress, c.telephone, b.title, concat(au.firstName,\' \',au.lastName) as author, b.pageCount, dateOrder FROM orders as o
  2.            JOIN Customers as c
  3.            ON o.userId = c.id
  4.            JOIN Adresses as a
  5.            on a.userId = c.id
  6.            JOIN Books as b
  7.            ON o.bookId = b.bookId
  8.            JOIN AutorsBooks as a_b
  9.            ON b.bookId = a_b.bookId
  10.            JOIN Autors as au
  11.            ON au.id = a_b.authorId
  12.            ORDER BY o.orderId'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement