Advertisement
Guest User

Untitled

a guest
May 21st, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MySQL 0.64 KB | None | 0 0
  1. SELECT orderId, c.firstname, c.secondname, concat(a.street,' ',a.city,' ',a.postcode) as adress, c.telephone, b.title, IFNULL (group_concat(au.firstName,' ',au.middleName,' ',au.lastname), group_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.             group by o.orderId
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement