Skip to content
Advertisement

How I can retrieve all data from the first table and some of the second table

I have two tables and the relation between them are NO. .

How I can write SQl query to give me output form table1 and table2 only for who id is 5050 and the output should be like this

Advertisement

Answer

This is an example of a LEFT JOIN — keeping all the rows in the first table but only matching rows in the second.

In your case, this looks like:

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement