I have two different tables and when I am trying to LEFT join it not working, I think I am using the right function to achieve the, even searched on google but did not get the expected output.
in return I am getting a ‘NULL’ value, Please help.
table1
ID | y_m
--------------
1 | 2023-04
2 | 2023-05
table2
ID | month | year
--------------------------
1 | 2023 | 04
2 | 2023 | 05
SELECT * FROM table2 LEFT JOIN table1 ON table1.y_m = DATE_FORMAT(CONCAT_WS('-', table2.year, table2.month) WHERE table2.year = 2023 AND table2.month = 05;
but this above MYSQL not working in myPHPAdmin
Please how to resolve this -