Question : mySQL join query how do I write

Table 1

webpage_link_id (int), webpage_id (int), webpage_RSlink1 (int),webpage_RSlink2 (int)

50,67,1,2


Table2

webpage_id (int) ,webpage_name,webpage_url
1. 1, level1, level1.asp
2. 2, level2, level2.asp

How do I write the sql query to get the following:


webpage_link_id,webpage_id,webpage_RSLink1,,webpage_name,webpage_url,webpage_RSLink2,webpage_name,webpage_url

50,57,1,level1,level1.asp,2,level2,level2.asp

Thank you.

Answer : mySQL join query how do I write

try ...
SELECT a.webpage_link_id, a.webpage_id, a.webpage_RSLink1, b.webpage_name, b.webpage_url, a.webpage_RSLink2, c.webpage_name, c.webpage_url
FROM table1 a
JOIN Table2 b ON a.webpage_RSLink1 = b.webpage_id
JOIN Table2 c ON a.webpage_RSLink2 = c.webpage_id
Random Solutions  
 
programming4us programming4us