'Maria DB how to format my sql statement to pull data from my table(s) into cells based on values in column and keywords in rows

Been a minute since I did SQL programming. I have a large table that can be broken up into several tables. What I need is where date and keyword row, put the "integer" in the cell. So I have the different years (not sequential, like 1950, 1956, 1958, 1961 ...) going across the top, keywords defining the rows and the integer in the cells.

And what is the best way to sort the columns in date order oldest to the newest. Different quantities of dates for each report.

Thanks



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source