Wrox Programmer Forums
|
ASP Forms As of Oct 5, 2005, this forum is now locked. Please use "Classic ASP beginner" at http://p2p.wrox.com/forum.asp?FORUM_ID=54 or "Classic ASP Professional" http://p2p.wrox.com/forum.asp?FORUM_ID=56 instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP Forms section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 22nd, 2005, 10:58 AM
Friend of Wrox
 
Join Date: May 2005
Posts: 149
Thanks: 0
Thanked 0 Times in 0 Posts
Default multitple inner join


Hello,
I have 3 tables guests,events,users
The user table is related to events table through EventID
and the guests table is related to users table through USERid
How can I join these 3 tables
I use:
Rs.open "select * from guests inner join events on guests.eventID=events.EventID ",Conn,3,3

but it relates just guests and event tables.
I believe I should use 2 inner join but I do not know how??


 
Old May 23rd, 2005, 06:24 AM
Authorized User
 
Join Date: Mar 2005
Posts: 33
Thanks: 0
Thanked 0 Times in 0 Posts
Default

SELECT *
FROM guests AS g
INNER JOIN events AS e ON e.EventID = g.EventID
INNER JOIN users AS u ON u.USERid = g.USERid

 
Old May 23rd, 2005, 08:56 AM
Friend of Wrox
 
Join Date: May 2005
Posts: 149
Thanks: 0
Thanked 0 Times in 0 Posts
Default

well I do not know whe I use this inner join I get this error
Syntax error (missing operator) in query expression 'e.EventID = g.EventID INNER JOIN users AS u ON u.id = g.USERid'.


 
Old May 24th, 2005, 02:02 AM
Authorized User
 
Join Date: Mar 2005
Posts: 33
Thanks: 0
Thanked 0 Times in 0 Posts
Default

The query will work on SQL Server and MySQL. If you're using Access I think you have to add a paranthesis, but I don't know where.

Try:

SELECT *
FROM (guests AS g
INNER JOIN events AS e ON e.EventID = g.EventID)
INNER JOIN users AS u ON u.USERid = g.USERid

or something like that.






Similar Threads
Thread Thread Starter Forum Replies Last Post
join dhara_adh SQL Server 2000 2 January 2nd, 2007 12:39 AM
Join or not join madhukp SQL Server 2000 3 February 2nd, 2005 01:11 AM
More than one join jaywhy13 Classic ASP Basics 2 January 31st, 2005 11:38 PM
INNER JOIN msmagied Classic ASP Databases 3 August 29th, 2004 12:28 PM
Oracle 8i inner join and left join problem puteri_84 Oracle 2 August 19th, 2004 07:14 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.