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.

 All Forums
 Other Forums
 MS Access
 inner join query help please....

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.mcountryid
from country as kuni ,usercountrymap
where usercountrymap.mcountryid = kuni.mcountryid
and usercountrymap.userid = $fuserid
inner join country
AS cont on kuni.mparent = cont.mcountryid
order by kuni.mparent,kuni.mcountrynameen

however 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 close

select cont.mcountryid, cont.mcountrynameen as continenten, cont.mcountrynamejp as continentjp, kuni.mparent, kuni.mcountrynameen, kuni.mcountrynamejp,kuni.mcountryid
from country as kuni
inner join usercountrymap usercountrymap.mcountryid = kuni.mcountryid
inner join country AS cont on kuni.mparent = cont.mcountryid
where usercountrymap.userid = $fuserid
order by kuni.mparent,kuni.mcountrynameen
Go to Top of Page
   

- Advertisement -