I can’t figure out what’s wrong with this query. Can you help?
SELECT tid, uid, points, FROM_UNIXTIME(time_stamp),
FROM userpoints_txn
WHERE YEAR(FROM_UNIXTIME(time_stamp)) = 2010
AND MONTH(FROM_UNIXTIME(time_stamp)) = 5
AND description LIKE ‘%inactivity%’;
kmillecam, a little tip about the layout of queries, if you lay them out like below (using your own one as an example), it doesn’t run any faster or slower but it makes it easier to spot mistakes like stray , and you’ll find queries more readable, especially when you have more complex queries involving joins and sub-queries.
SELECT
tid
, uid
, points
, FROM_UNIXTIME(time_stamp)
FROM
userpoints_txn
WHERE
YEAR(FROM_UNIXTIME(time_stamp)) = 2010
AND
MONTH(FROM_UNIXTIME(time_stamp)) = 5
AND
description LIKE '%inactivity%'