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
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Assistance with Query.

Author  Topic 

jacisme
Starting Member

34 Posts

Posted - 2007-09-27 : 18:53:40
Thanks to everyone for your help.

SQL 2000
ASP VB

I need help with a query, I'll do my best to explain what I am looking for.

tbl_Games
GameID

tbl_SeriesList
SeriesID

tbl_SeriesJoin
SeriesJoinID
SeriesID
GameID

I would like to retrieve all of the games that are joined to it's SeriesList. My issue is that I only can use the GameID to retrieve all of the games that are part of the same SeriesList.

My experience only allows me to retrieve the one game that is accociated with the GameID, but I need all of the others.

I'm sure you'll need better information as to what I am looking for, but hopefully it will be a start.

Thanks again,
JAC

dinakar
Master Smack Fu Yak Hacker

2507 Posts

Posted - 2007-09-27 : 18:58:40
Please also post some sample data from each table and expected output.

Dinakar Nethi
************************
Life is short. Enjoy it.
************************
http://weblogs.sqlteam.com/dinakar/
Go to Top of Page

jacisme
Starting Member

34 Posts

Posted - 2007-09-27 : 19:05:07
Thanks dinakar.

tbl_Games
GameID
GameTitle
GameLink

tbl_SeriesList
SeriesID
SeriesName

tbl_SeriesJoin
SeriesJoinID
SeriesID
GameID

I would like a list of games such as:

WHERE GameID = 50001

GameID=======GameTitle=======SeriesName
50001========Tomb Raider=====Tomb Raider
50502========Tomb Raider 2====Tomb Raider
50402========Tomb Raider 3====Tomb Raider

Something like that would be great!


Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2007-09-27 : 20:01:25
[code]
SELECT G2.GameID, G2.GameTitle, SL.SeriesName
FROM tbl_Games AS G
JOIN tbl_SeriesJoin AS SJ1
ON SJ1.GameID = G.GameID
JOIN tbl_SeriesList AS SL
ON SL.SeriesID = SJ1.SeriesID
JOIN tbl_SeriesJoin AS SJ2
ON SJ2.SeriesID = SJ1.SeriesID
JOIN tbl_Games AS G2
ON G2.GameID = SJ2.GameID
WHERE G.GameID = 50001
[/code]
Kristen
Go to Top of Page

jacisme
Starting Member

34 Posts

Posted - 2007-09-27 : 21:55:35
Worked perfectly the first time!! Thank you Kristen and thank you SQLTeam.com... again! ;)

JAC
Go to Top of Page
   

- Advertisement -