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 June 27th, 2005, 10:49 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 100
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to ~Bean~
Default Simple Query Need Help

Please help with my simple query...I have 2 tables in a FORUM Database for Users and Threads. I am trying to return all the usernames that have posted in a Thread.

tblUsers
UserID
UserName
etc...

tblThreads
ThreadID
TopicSubject
UserID
UserPost
etc...

???

-------------------------
Beware of programmers with screwdrivers...
__________________
-------------------------
Beware of programmers with screwdrivers...
 
Old June 27th, 2005, 11:13 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 196
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Try this:

Code:
SELECT DISTINCT ThreadID, UserName 
FROM tblUsers u
INNER JOIN tblThreads t
   ON u.UserID = t.UserID
Rand
 
Old June 27th, 2005, 11:22 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 100
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to ~Bean~
Default

thx Rand!

-------------------------
Beware of programmers with screwdrivers...





Similar Threads
Thread Thread Starter Forum Replies Last Post
Simple query question ltblue14 Access 3 July 16th, 2006 02:10 PM
Simple Query help pls? Mitch_A SQL Language 5 February 3rd, 2006 05:13 PM
Simple query errors Justine Access 5 February 12th, 2004 09:43 AM
Simple Tomcat Query? Baztec Apache Tomcat 0 January 13th, 2004 11:38 PM





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