|
-
Mar 2nd, 2002, 12:47 PM
#1
Thread Starter
Hyperactive Member
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?
-
Mar 2nd, 2002, 02:56 PM
#2
Thread Starter
Hyperactive Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|