Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
avr
Starting Member
1 Post |
Posted - 2009-12-27 : 07:40:44
|
| I have the followingTable1areaid, area_latitude, area_longitudeTable2areaid_a, areaid_b, area_a_name, area_b_namewhat I want my sql query to return is to bring in one row the latitude and longitude for both the areas for which areaid_a=areaid and areaid_b=areaidiearea_latitude, area_longitude, areaid_a, areaid_b, area_latitude, area_longitude, area_a_name, area_b_nameThanks |
|
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2009-12-27 : 11:59:02
|
You can join table2 twice with different aliases:select ...from table1 t1join table2 t2aon t2a.ariaid_a = t1.areaidjoin table2 t2bon t2b.ariaid_b = t1.areaid No, you're never too old to Yak'n'Roll if you're too young to die. |
 |
|
|
|
|
|