Home : General : Databases and SQL :

General: Databases and SQL: Re: [fuzzy logic] subquery problem: Edit Log

Here is the list of edits for this post
Re: [fuzzy logic] subquery problem
ugh.. duh... don't know why I didn't try just adding:
Code:
count(posts.thread_id)

I now have:
Code:
SELECT threads.id AS thread_id,
threads.updated AS last_post_time,
threads.last_post_id AS last_post_id,
posts.subject AS subject,
users.id AS user_id,
users.user_name AS user_name,
COUNT(posts.thread_id) - 1 AS replies
FROM threads,
posts,
users
WHERE threads.id = posts.thread_id AND
users.id = posts.user_id
GROUP BY threads.id
ORDER BY threads.updated DESC

Philip
------------------
Limecat is not pleased.

Last edited by:

fuzzy logic: Feb 26, 2004, 10:29 PM

Edit Log: