Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Database > SQL Language
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old June 27th, 2005, 10:49 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: , , USA.
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...
Reply With Quote
  #2 (permalink)  
Old June 27th, 2005, 11:13 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: Naperville, IL, USA.
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
Reply With Quote
  #3 (permalink)  
Old June 27th, 2005, 11:22 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: , , USA.
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...
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 12:23 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.