Thread: SQL masters:
View Single Post
Old 02-09-2006, 06:15 AM  
Pryda
Confirmed User
 
Industry Role:
Join Date: Dec 2005
Posts: 905
Quote:
Originally Posted by Zester
What is wrong with this Sub Query:
Code:
SELECT date 
FROM  `records` 
WHERE  STATUS  =  'published' 
AND date = ( select max(date) FROM `records` )
LIMIT = 25;
it's suppose to spit out the date of the latest 25 articles in 'published' status and nothing more.

Your query wants up to 25 record dates for articles published on the same date as the most recent record (published or not).
__________________
Babepedia
Pryda is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote