How to write an SQL query that counts the number of rows per month and year?
问题 Had anyone any idea how to query a vbulletin database to generate a report on the number of registrations per month/year to achive results like.. MM/YYYY Count 01/2001 : 10 02/2001 : 12 ... ... Thanks to those answers below.. My final version that works is as follows: SELECT COUNT(*) as 'Registrations', YEAR(FROM_UNIXTIME(joindate)) as 'Year', MONTH(FROM_UNIXTIME(joindate)) as 'Month' FROM vbfuser GROUP BY Year,Month 回答1: I am not familiar with vBulletin's database structure, but you should