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 |
akun
Starting Member
1 Post |
Posted - 2005-09-18 : 22:55:08
|
hello,i'm trying to do a straight join on two tables, followed by a self join on one table using parent/child relationship.the query i have so far is this:select cont.mcountryid, cont.mcountrynameen as continenten, cont.mcountrynamejp as continentjp, kuni.mparent, kuni.mcountrynameen, kuni.mcountrynamejp,kuni.mcountryidfrom country as kuni ,usercountrymapwhere usercountrymap.mcountryid = kuni.mcountryidand usercountrymap.userid = $fuseridinner join country AS cont on kuni.mparent = cont.mcountryidorder by kuni.mparent,kuni.mcountrynameenhowever this throws a syntax error. im using access with an odbc driver, any ideas? |
|
AndrewMurphy
Master Smack Fu Yak Hacker
2916 Posts |
Posted - 2005-09-19 : 08:30:30
|
you were mixing programming styles....below should be closeselect cont.mcountryid, cont.mcountrynameen as continenten, cont.mcountrynamejp as continentjp, kuni.mparent, kuni.mcountrynameen, kuni.mcountrynamejp,kuni.mcountryidfrom country as kuniinner join usercountrymap usercountrymap.mcountryid = kuni.mcountryidinner join country AS cont on kuni.mparent = cont.mcountryidwhere usercountrymap.userid = $fuseridorder by kuni.mparent,kuni.mcountrynameen |
 |
|
|
|
|
|
|