I have 2 tables named 'user_table' and 'country_table'. (user_table) name cc dd ----- -- -- AAAA US IN BBBB UK US CCCC US US (country_table) code name ---- ----- US United States UK United Kingdom AU Australia I want to run a query that produce the result like the following name cc_country dd_country ----- ---------- ----------- AAAA United States India BBBB United Kingdom United States CCCC United States United States What will be the query? My friends please help me.
SELECT user_table.name, country_table_1.name, country_table_2.name FROM user_table INNER JOIN country_table AS country_table_1 ON user_table.cc = country_table.code INNER JOIN country_table AS country_table_2 ON user_table.dd = country_table.code Code (markup):