Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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
- JOIN Customers as c
- ON o.userId = c.id
- JOIN Adresses as a
- on a.userId = c.id
- JOIN Books as b
- ON o.bookId = b.bookId
- JOIN AutorsBooks as a_b
- ON b.bookId = a_b.bookId
- JOIN Autors as au
- ON au.id = a_b.authorId
- group by o.orderId
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement