Del manual de mysql...
Código sql:
Ver originalSELECT titulo,visitas
FROM noticias
WHERE created BETWEEN
DATE_SUB(NOW(),INTERVAL 5 DAY)
AND NOW()
ORDER BY visitas DESC LIMIT 10
Cita: expr BETWEEN min AND max
If expr is greater than or equal to min and expr is less than or equal to max, BETWEEN returns 1, otherwise it returns 0. This is equivalent to the expression (min <= expr AND expr <= max) if all the arguments are of the same type. Otherwise type conversion takes place according to the rules described in Section 11.2.2, “Type Conversion in Expression Evaluation”, but applied to all the three arguments.
Primero el minimo y luego el maximo...
Pero esto quizas es mas simple no...
Código sql:
Ver originalSELECT titulo,visitas
FROM noticias
WHERE created > DATE_SUB(NOW(),INTERVAL 5 DAY)
ORDER BY visitas DESC LIMIT 10
Quim