here is my problem.
I have two tables,
Table1 –
id | Name | Code
1 | test | 4
2 | test | 5
3 | test4| 6
4 | test4| 7
5 | test | 8
6 | test | 9
Table2 –
id | Code
1 | 4
2 | 5
3 | 6
4 | 7
5 | 8
6 | 9
Here the Code column is the same in the both tables, what I’m trying is, I’m having the Code From Table2 AND I’m selecting the other table with it. For example
SELECT * FROM Table2 LEFT JOIN Table1.Code = Table2.Code WHERE Table2.Code = 4 , that’s fine, now I’m getting the results from both tables for the same Code, but now, from that point when I have Table1, I want to get All the rows With the same Name . The expected result I want is
id | Name | Code
1 | test | 4
2 | test | 5
5 | test | 8
6 | test | 9
You can try something like
or even