This topic is closed.. i found an answer which shows the desired output using subqueries.
SELECT table_a.id, table_a.col as col, (select col2 from table_b WHERE col1 = col AND col3 = 'me' LIMIT 1) as table_b_col2, (select col3 from table_b WHERE col1 = col AND col3 = 'me' LIMIT 1) as table_b_col3 FROM table_a
I have two tables:
Table A
ID | COL
1 | A
2 | B
3 | C
4 | D
Table B
ID1 | COL1 | COL2 | COL3
1 | A | 60 | me
2 | B | 45 | me
Now i wanted to fetch records like this
Expected result:
ID1 | COL1 | COL2 | COL3
1 | A | 60 | me
2 | B | 45 | me
3 | C | |
4 | D | |
I already tried using left join but it only gives the rows from table b with values
TEST TABLE:
ID | COL1 | COL2 | COL3
1 | A | 60 | me
2 | B | 45 | me
Any ideas on how to implement this or maybe you can share your codes.. thank you