Один пример - когда у Вас есть зависимости между объектами... т.е.: Документ-> DocumentItems (при удалении Документа DocumentItems не имеют причины существовать)
Запрос max
должен быть в отдельном подзапросе, поэтому ваш окончательный SQL должен быть ::
SELECT features.featureTitle AS title,
features.featureSummary AS body,
features.postedOn AS dummy,
DATE_FORMAT( features.postedOn, '%M %d, %Y' ) AS posted,
NULL,
NULL,
staff.staffName,
features.featureID
FROM
features
LEFT JOIN staff ON
features.staffID = staff.staffID
WHERE
features.postedOn != (select max(features.postedOn) from features)
the problem you have is that is that you need to find the max (latest) feature from the table, while going over each row, but MAX() is a group function - you have to group all rows to use it.
you can use a sub-select to get the id of the last feature:
WHERE featureId <> (SELECT featureId From features ORDER BY postedOn DESC LIMIT1)
there is a problem with this approach - the subselect is run for every row, but it is not that expensive.