I have a database MySQL 8.0 with 12 tables (one of each month) with information about clients. All tables have a Client ID and the amount of money that they save. For example, for two months:
+------------------+
+ January +
+------------------+
+ ClienID | Amount +
+------------------+
+ qwer23 | 23 +
+------------------+
+ December +
+------------------+
+ ClienID | Amount +
+------------------+
+ qwer23 | 15 +
And I want to get a table with the ClientID and the Amount of each month. Like this
+------------------+----------------+----------+
+ ClienID | January| | December |
+------------------+----------------+----------+
+ qwer23 | 23 | | 15 |
I search some options, but I'm not sure how to use JOIN or GROUP+BY.
GROUP BY, because there is nothing to aggregate. The tables already contain the amounts you want to show. It is just about joins. Full outer joins would be perfect, by MySQL does not support them. So, select from the clients table, then outer join the months.