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.
Author |
Topic |
jacisme
Starting Member
34 Posts |
Posted - 2007-09-27 : 18:53:40
|
Thanks to everyone for your help.SQL 2000ASP VBI need help with a query, I'll do my best to explain what I am looking for.tbl_GamesGameIDtbl_SeriesListSeriesIDtbl_SeriesJoinSeriesJoinIDSeriesIDGameIDI 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/ |
 |
|
jacisme
Starting Member
34 Posts |
Posted - 2007-09-27 : 19:05:07
|
Thanks dinakar.tbl_GamesGameIDGameTitleGameLinktbl_SeriesListSeriesIDSeriesNametbl_SeriesJoinSeriesJoinIDSeriesIDGameIDI would like a list of games such as:WHERE GameID = 50001GameID=======GameTitle=======SeriesName50001========Tomb Raider=====Tomb Raider50502========Tomb Raider 2====Tomb Raider50402========Tomb Raider 3====Tomb RaiderSomething like that would be great! |
 |
|
Kristen
Test
22859 Posts |
Posted - 2007-09-27 : 20:01:25
|
[code]SELECT G2.GameID, G2.GameTitle, SL.SeriesNameFROM 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.GameIDWHERE G.GameID = 50001[/code]Kristen |
 |
|
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 |
 |
|
|
|
|