MySQL Forums
Forum List  »  Newbie

Re: Nested SELECT
Posted by: Preston McMurry
Date: April 12, 2005 01:56PM

Actually, you appear to be missing one brace, and have two extras:

<pre>
SELECT DISTINCT YEAR(content.date)
FROM content
WHERE (
(
(
YEAR( content.date )
) IS NOT null
)
)
AND YEAR( content.date ) <
(
SELECT YEAR
(
MAX ( content.date )
)
<-- missing parens
FROM content
) <-- extra parens
) <-- extra parents
ORDER BY YEAR(content.date) DESC

================================================================================

SELECT DISTINCT YEAR( `date` )
FROM content
WHERE YEAR( `date` ) IS NOT null
AND YEAR( `date` ) <
(
SELECT YEAR
(
MAX ( `date` )
)
)
FROM content
ORDER BY YEAR( `date` ) DESC
</pre>

http://prestonm.com ... http://www.mcmurry.com

Options: ReplyQuote


Subject
Written By
Posted
April 12, 2005 01:41PM
April 12, 2005 01:48PM
Re: Nested SELECT
April 12, 2005 01:56PM
April 13, 2005 10:36AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.