Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Database > SQL Language
|
SQL Language SQL Language discussions not specific to a particular RDBMS program or vendor.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Language 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 28th, 2006, 01:57 PM
Registered User
 
Join Date: May 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Need Help with Inner Join

Hi all.
I have 3 tables:(Im using Access)

USERS-
--userID
--userName
Messages-
--MessageID
--PostDate
--Title
--userid
Categories-
--CateId
--name
--lastMessageId

now, I want to select all the categories names, the postdate and title of the message with the LastMessageId of the category, in addition I want to select the username by the userid of the message which was selected by the lastmessageid of the category.

Hope you understand, thanks!


 
Old May 31st, 2006, 02:39 AM
Authorized User
 
Join Date: Mar 2006
Posts: 80
Thanks: 0
Thanked 0 Times in 0 Posts
Default

SELECT CATEGORIES.name, MESSAGES.PostDate, MESSAGES.Title, USERS.userName
FROM USERS INNER JOIN (MESSAGES INNER JOIN CATEGORIES ON MESSAGES.MessageID = CATEGORIES.lastMessageID) ON USERS.userID = MESSAGES.userID;






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.