database - How to display integer to string in MySQL? -
i have 2 table table1 , table2.
in table1
id country ------------ 1 india 2 usa 3 pak 4 aus 5 newzealand many more
in table2
u_id country_id ------------ 1 3 2 1 3 2 4 3 5 1 many more
i need output like
u_id country_id ------------ 1 pak 2 india 3 usa 4 pak 5 india many more
i tried join query
select table1.country, table2.country_id table1 inner join table2 table1.id = table2.u_id
can me without case?
select b.u_id, a.country country_id table1 left join table2 b on a.id = b.u_id
Comments
Post a Comment