SureshKumar Vegesna SureshKumar Vegesna - 2 months ago 9
MySQL Question

Is it possible Mysql query by inner join

i would get details from two MySQL tables

tables structure as shown

table:App
|AppID|AppName|AppType|

table:AppRelease
|AppReleaseID|AppID|ReleaseDate|ReleaseVersion|


and written query as shown below

$query="
SELECT
A.*,
B.ReleaseDate,
B.ReleaseVersion
FROM App AS A
INNER JOIN AppRelease AS B
WHERE A.AppID = B.AppID
";


i get the values when appid is in both tables

but i also want to get values from App table though i dont have data in AppRelease release table

is it possible to write query please help me

Answer

Your requirement shouldn't be inner join.

Use left join:

$query= "SELECT A.*,B.ReleaseDate,B.ReleaseVersion
             from App as A LEFT JOIN AppRelease as B 
             ON A.AppID=B.AppID";