Help with an SQL Statement
From: Reapes (nospam.reapesuk_at_hotmail.com)
Date: 09/18/04
- Next message: Brian Vallelunga: "Re: Summing columns in table function? (Followup question)"
- Previous message: Mary Chipman: "Re: Secutiry of db files"
- Next in thread: Nigel Rivett: "RE: Help with an SQL Statement"
- Reply: Nigel Rivett: "RE: Help with an SQL Statement"
- Reply: Joe Celko: "Re: Help with an SQL Statement"
- Messages sorted by: [ date ] [ thread ]
Date: Sat, 18 Sep 2004 21:07:22 GMT
Hi Group,
I have two tables in SQL Server.
Table one is called Category with fields :
CategoryID and CategoryName.
Table two is called SubCategory with fields:
SubCategoryID
CategoryID
SubCategoryName
In Table one I have say 2 categories, Birthday and Easter.
In Table two I have 2 sub categories of Male and Female which are sub
categories of Table ones Birthday entry.
What I would Like to return (if possible) using an SQL statement is the
following:
Birthday
Male
Female
Easter
i.e. first the MAIN category, then the sub categories for that main category
then onto the next category etc etc.
All the queries I have tried failed miserably! Is there any sql gurus out
there that can point me in the right direction?
Many Thanks
Reapes
- Next message: Brian Vallelunga: "Re: Summing columns in table function? (Followup question)"
- Previous message: Mary Chipman: "Re: Secutiry of db files"
- Next in thread: Nigel Rivett: "RE: Help with an SQL Statement"
- Reply: Nigel Rivett: "RE: Help with an SQL Statement"
- Reply: Joe Celko: "Re: Help with an SQL Statement"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|