![]() |
SQL masters:
What is wrong with this Sub Query:
Code:
SELECT date |
i was thinking, is there a way to rewrite that query using 'order by id' or 'date' instead, without using a sub query. That'll be a simpler approach.
like select from `records` where status = 'published' order by id desc limit 0, 25; |
select date from records where status='published' order by date desc LIMIT 25;
|
Quote:
|
Quote:
Your query wants up to 25 record dates for articles published on the same date as the most recent record (published or not). |
SELECT date
FROM `records` WHERE STATUS = 'published' ORDER BY date DESC LIMIT 25; |
| All times are GMT -7. The time now is 09:25 PM. |
Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2026, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123