I'm not a mysql expert, but: at the beginning you have
FROM_UNIXTIME(lastactivity) lastactivity
then in the WHERE you have another FROM_UNIXTIME(lastactivity). Wouldn't that end up doing a FROM_UNIXTIME() on something that's already been converted?
Or maybe not. Edit: no, I guess you can't use column aliases in a WHERE, so it has to refer to the table column. Never mind.
|