Re: [SQL]
From: Chris Hope (blackhole_at_electrictoolbox.com)
Date: 10/29/04
- Next message: Theo: "Re: Dynamic webpage update?"
- Previous message: SWP: "Re: Dynamic webpage update?"
- In reply to: Wes S.: "[SQL]"
- Next in thread: Wes S.: "Re: [SQL]"
- Reply: Wes S.: "Re: [SQL]"
- Reply: Mike Harvey: "Re: [SQL]"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Fri, 29 Oct 2004 18:52:40 +1300
Wes S. wrote:
> 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.
Find out which version of MySQL you are using. If it is 4.0.x or lower there
*is no* support for subqueries. They were added only in 4.1.0 which has
only just had its production level release this week.
-- Chris Hope - The Electric Toolbox - http://www.electrictoolbox.com/
- Next message: Theo: "Re: Dynamic webpage update?"
- Previous message: SWP: "Re: Dynamic webpage update?"
- In reply to: Wes S.: "[SQL]"
- Next in thread: Wes S.: "Re: [SQL]"
- Reply: Wes S.: "Re: [SQL]"
- Reply: Mike Harvey: "Re: [SQL]"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|