Query help

Results 1 to 2 of 2

Thread: Query help

  1. #1
    Mitch Trope Guest

    Default Query help

    I am trying to write a query to output a correctly-ordered list of replies in a message board. The fields I have available are the messageID (primary key), levelID (0 for master thread, 1 for replies to master, 2 for replies to level 1 messages, etc.), date created (usually unique, but not necessarily), master thread ID (contains message ID of the master thread), reply to (contains message ID of the message you are replying to - this is the same as the current message ID for a master thread) and a bit field called has replies (0 if the message has no replies, 1 if it does have replies). I have tried ordering by every combination I could think of, to no avail. Is there a way to write a query to get the list I need, or do I need to write a loop to accomplish this?

  2. #2
    Join Date
    Dec 1969

    Default You can't do it that way...

    There is no possible single query that will return a fully threaded forum in order. <BR><BR>Take a peek at this, though: http://www.sqlteam.com/ItemComments.asp?ItemID=1353<BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts