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 |
|
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2004-06-17 : 15:03:29
|
| user writes "I have three tables like tblcategory,tblforum,tbltopic tblcategory contains all the categoriestblforum contains forums under the categories.tbltopic contains topics under the forums.I want to display all topics based on forums and categories.i need stored procedure for thatmy tables aretblcategory----------Cat_ID cat_nameCat_order tblforum--------Forum_IDCat_idForum_OrderForum_nameForum_descriptionDate_Started....tbltopic---------Topic_IDForum_IDSubjectStart_dateLast_entry_date..." |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2004-06-17 : 15:17:32
|
| So what would the expected result set look like?Tara |
 |
|
|
X002548
Not Just a Number
15586 Posts |
Posted - 2004-06-17 : 15:41:46
|
| Just join the tables together on the ids?Brett8-) |
 |
|
|
derrickleggett
Pointy Haired Yak DBA
4184 Posts |
Posted - 2004-06-17 : 17:48:24
|
| CREATE PROCEDURE whatisgoingonhere@forum VARCHAR(666),@category VARCHAR(666)AS SELECTt.Topic_ID,t.Forum_ID,t.SubjectFROMtblcategory cINNER JOIN tblforum f ON c.Cat_id = f.Cat_idINNER JOIN tbltopic t ON f.Forum_ID = t.Forum_IDWHEREc.cat_name = @categoryAND f.Forum_name = @forumYou should consider being more standardized with how you name things. :)MeanOldDBAderrickleggett@hotmail.comWhen life gives you a lemon, fire the DBA. |
 |
|
|
|
|
|