Jay Sprenkle <[EMAIL PROTECTED]> writes:

> If you just want 10 records with the highest modified or created time I 
> think this will do it:
>
> select *
> from tbl 
> order by max(created_on,modified_on) desc
> limit 10

except that if modified_on is null, you won't get that record.  This variation
should fix that problem:


SELECT *
  FROM tbl 
  ORDER BY MAX(created_on, COALESCE(modified_on, 0)) DESC
  LIMIT 10;


Derrell

Reply via email to