S
S
Shultc2018-06-20 18:03:02
MySQL
Shultc, 2018-06-20 18:03:02

How to rotate a table in SQL or php and connect to another through a third one?

I have something like this database structure:

table_one ---(many)---< table_pivot >---(many)--- table_two

Let's assume they have:
  • table_one — Products
  • table_two - People
  • table_pivot - Numerical evaluation of the product

How do I get a table that has products on the horizontal axis, people on the vertical axis, and ratings in the cells in between?
If this cannot be done directly in SQL, then it can be processed in php. I imagine the result is something like this:
5b2a6ce4e5295310118687.png
Thank you in advance.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
d-stream, 2018-06-20
@d-stream

In my opinion, MySQL can pivot - then this is the best option.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question