Results 1 to 2 of 2

Thread: SQL & Forum Thread

  1. #1

    Thread Starter
    Hyperactive Member DKCK's Avatar
    Join Date
    Dec 2000
    Location
    United States
    Posts
    329

    SQL & Forum Thread

    I've created a user forum and need to have the ability for users to search messages. I can easily search each each message for the request criteria.

    SELECT ForumMessages.Message
    FROM ForumMessages
    WHERE (((ForumMessages.Message) Like '*br*'));

    However I do not need each message, what I need is each thread that has the search criteria. My question is how do I take only the top thread when doing the 'Like' query. Would a sub query work?

  2. #2

    Thread Starter
    Hyperactive Member DKCK's Avatar
    Join Date
    Dec 2000
    Location
    United States
    Posts
    329

    Red face

    SELECT ForumMessages.Message
    FROM ForumMessages
    WHERE ID IN (SELECT IIF(ParentID=0,ID,ParentID) FROM ForumMessages WHERE ForumMessages.Message Like '*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
  •  



Click Here to Expand Forum to Full Width