Click here to Skip to main content
15,904,288 members
Home / Discussions / Database
   

Database

 
GeneralRe: How can I run SQL ver 9.0 Pin
Dave Kreskowiak25-Feb-06 17:17
mveDave Kreskowiak25-Feb-06 17:17 
GeneralRe: How can I run SQL ver 9.0 Pin
Majid Shahabfar25-Feb-06 19:10
Majid Shahabfar25-Feb-06 19:10 
AnswerRe: How can I run SQL ver 9.0 Pin
Dave Kreskowiak26-Feb-06 1:48
mveDave Kreskowiak26-Feb-06 1:48 
QuestionData access Layer Pin
Dotnet2Learner24-Feb-06 17:02
Dotnet2Learner24-Feb-06 17:02 
AnswerRe: Data access Layer Pin
Colin Angus Mackay24-Feb-06 17:04
Colin Angus Mackay24-Feb-06 17:04 
GeneralRe: Data access Layer Pin
Dotnet2Learner24-Feb-06 17:50
Dotnet2Learner24-Feb-06 17:50 
GeneralRe: Data access Layer Pin
Dave Kreskowiak25-Feb-06 17:15
mveDave Kreskowiak25-Feb-06 17:15 
QuestionSQL help Pin
sebastian yeok24-Feb-06 15:24
sebastian yeok24-Feb-06 15:24 
basically i have 4 columns in the table called Forum. There are TopicId, Subject, Date and RelTopicId. For every new thread and reply on the thread, the TopicId is unique, which means for every record saved has an unique ID. For every new thread the RelTopicId will set to 0 and for every reply on the topic will set to the TopicId of the thread. This is how it look like.

TopicId Subject Date RelTopicId
1 asp 2/12/2006 11:40:40AM 0 (This is a new thread)
2 RE asp 2/12/2006 11:56:10 PM 1 (A reply on subject asp)
3 RE asp 2/12/2006 12:45:12 PM 1 (A reply on subject asp)
4 Vb.net 2/13/2006 13:40:54 PM 0 (A new thread)
5 RE Vb.net 2/13/2006 13:59:51 PM 4 (A reply on Vb.net)
6 RE asp 2/14/2006 10:20:30 AM 1 (A replt on asp)

TopicId 1 and RelTopicId 0 is the parent, and all the RelTopicId 1 is the child to the Parent which is TopicId 1."note all RelTopicId = 0 is a new thread"

here is the sql statement to retrive data
select * from Forum where Date >='2006-2-12' and Date <'2006-2-13 and TopicId = "0"
this is to get the parent.

my question is how to retrive the parent and the child data. This is to get the Parent(TopicId = 1, RelTopicId = 0) and the child which is (all RelTopicId = 1)

i have try this "select * from Forum where Date >='2006-2-13' and Date <='2006-2-14 and TopicId = "0" and RelTopicId = TopicId"

i got no luck. any help appreciate thanks.
AnswerRe: SQL help Pin
Colin Angus Mackay24-Feb-06 17:03
Colin Angus Mackay24-Feb-06 17:03 
QuestionCoding efficiency question Pin
Vodstok24-Feb-06 9:42
Vodstok24-Feb-06 9:42 
AnswerRe: Coding efficiency question Pin
Expert Coming24-Feb-06 10:05
Expert Coming24-Feb-06 10:05 
GeneralRe: Coding efficiency question Pin
Vodstok27-Feb-06 2:24
Vodstok27-Feb-06 2:24 
GeneralRe: Coding efficiency question Pin
Andy Brummer27-Feb-06 18:53
sitebuilderAndy Brummer27-Feb-06 18:53 
AnswerRe: Coding efficiency question Pin
Andy Brummer27-Feb-06 18:56
sitebuilderAndy Brummer27-Feb-06 18:56 
GeneralRe: Coding efficiency question Pin
Vodstok28-Feb-06 1:44
Vodstok28-Feb-06 1:44 
QuestionSQL+C# Pin
papa198024-Feb-06 7:16
papa198024-Feb-06 7:16 
AnswerRe: SQL+C# Pin
Colin Angus Mackay24-Feb-06 16:52
Colin Angus Mackay24-Feb-06 16:52 
GeneralRe: SQL+C# Pin
papa198026-Feb-06 22:25
papa198026-Feb-06 22:25 
GeneralRe: SQL+C# Pin
Colin Angus Mackay26-Feb-06 22:34
Colin Angus Mackay26-Feb-06 22:34 
GeneralRe: SQL+C# Pin
papa198027-Feb-06 0:41
papa198027-Feb-06 0:41 
Questionadding rows is access database file Pin
iramg24-Feb-06 3:44
iramg24-Feb-06 3:44 
AnswerRe: adding rows is access database file Pin
papa198024-Feb-06 4:37
papa198024-Feb-06 4:37 
GeneralRe: adding rows is access database file Pin
iramg24-Feb-06 4:42
iramg24-Feb-06 4:42 
AnswerRe: adding rows is access database file Pin
Seivan25-Feb-06 2:28
Seivan25-Feb-06 2:28 
QuestionWork with var Pin
papa198024-Feb-06 1:37
papa198024-Feb-06 1:37 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.