I have the following two tables:
table1
id
name
ownedby
table2
id
ownername
Here, in table1, ownedby can be 0 (to mean it is not owned by anyone) or refers to id column of table2. Now what I want is to get data from table1 but get ownername from table2 if owenedby>0
The output basically is to be:
1 0 ==>owned by no one
2 Barka =======> owned by barka