Answer the question
In order to leave comments, you need to log in
What is the correct way to write such a SQL query?
There are 2 tables. Such a query is required that will receive the combined data from two tables, while the fields (columns) of the resulting table will be the values of one of the tables (an example of which I want is approximately shown in the picture, it is difficult to describe). Please help anyone who can. Where to dig? What will be applied? Which way to look? If there is an example - I will be grateful! ))
Answer the question
In order to leave comments, you need to log in
The task nontrivial, it is the best of all to write procedure.
Oracle has PIVOT and UNPIVOT functions (data transposition), they have implementations for older versions as separate procedures, try digging in that direction.
And in general, google transposition in MySQL, for example: buysql.com/mysql/14-how-to-automate-pivot-tables.html
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question