[SQL]
From: Wes S. (MornIHATESPAMThdr_at_NOSPAMverizon.net)
Date: 10/29/04
- Next message: Gordon Burditt: "Re: security of sessions"
- Previous message: Gordon Burditt: "Re: How to make string of numbers shorter?"
- Next in thread: Chris Hope: "Re: [SQL]"
- Reply: Chris Hope: "Re: [SQL]"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Fri, 29 Oct 2004 04:37:31 GMT
Running: MySQL (version unknown)
SELECT *
FROM (
SELECT ncf_news.news_id AS `news_id`,
COUNT(ncf_news_comments.comment_id) AS `comments`
FROM ncf_news
LEFT OUTER JOIN ncf_news_comments
ON (ncf_news.news_id = ncf_news_comments.nnw_news_id)
GROUP BY news_id
) AS `sq`
JOIN ncf_news
ON (sq.news_id = ncf_news.news_id)
WHERE disabled IS NULL;
Can anyone help me with that query. All columns are valid. I'm getting an
error with the SubQuery SELECT part. I know that the subquery alone will
work.
-Wes
- Next message: Gordon Burditt: "Re: security of sessions"
- Previous message: Gordon Burditt: "Re: How to make string of numbers shorter?"
- Next in thread: Chris Hope: "Re: [SQL]"
- Reply: Chris Hope: "Re: [SQL]"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]