|
First of all, thank God for your return! I was looking for your contact
information just two days ago and was disappointed that I couldn't find it.
I have a general question that is probably considered fairly advanced. If
possible, I'd like the answer to apply to Microsoft Access, Microsoft SQL
Server 7.0, and Oracle 8i. I'd be most interested in Access and SQL.
Is there a way to do a "recursive join?" In other words, I'd like a table to
link back to itself. For example, if I had a single table that stored
messages
for a message forum, and I wanted to query all posts from a particular
thread,
can I do it? Let's assume that the message table has the following fields:
PostID
ParentPostID
DatePosted
AuthorName
Subject
MessageText
Now, I'd like to perform this query based on the initial (or root) PostID
(in
this case, the ParentPostID would be 0). I'd like the query to return all
records that are "linked" beneath it. As you can probably guess,
ParentPostID
would be a link to the PostID of this post's parent.
I know that I can accomplish this with multiple queries and/or tables, but
it
would be much more useful and elegant if I could link back onto itself. |