I have the following table (MySQL) called "tweets":
tweet_id created_at --------------------- 1 1298027046 2 1298027100 5 1298477008
I want MySQL to return the number of tweets per day of the week; taking the above data, he should return:
Wednesday 1 Friday 2
Now I have the following query (which should return the week index, not the full name):
SELECT COUNT(`tweet_id`), WEEKDAY(FROM_UNIXTIME(`created_at`)) FROM tweets2 ORDER BY WEEKDAY(FROM_UNIXTIME(`created_at`))
This returns:
COUNT(`tweet_id`) WEEKDAY(FROM_UNIXTIME(`created_at`)) 7377 4
(There are 7377 tweets in the database). What am I doing wrong?
sql mysql
Pr0no
source share