View Full Version : query help
Lpspider
12-15-2007, 04:13 AM
Okay, what I'd like to do is query the database to output only unanswered threads from specific forums.
I'm sorry that i'm basically asking for help but I haven't worked with creating a query in quite a while.
Could anyone help me out? Thanks.
Kirk Y
12-15-2007, 05:00 AM
Basic example:
SELECT threadid, title
FROM thread
WHERE replycount = 0 AND forumid IN (X,Y,Z)
Lpspider
12-15-2007, 11:29 PM
Thank you. This helps very much. Would it be possible to somehow restrict the replies from the user who posted the original thread in counting for the replycount? So if the user posts a thread and replies to it twice, the results from the query will still be the same as replycount = 0, even though technically there were two replies (from the thread-posting user)?
Kirk Y
12-16-2007, 12:49 AM
Try this:
SELECT threadid, title
FROM thread
WHERE (replycount = 0 OR postusername = lastposter) AND forumid IN (X,Y,Z)
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.