This question already has an answer here:
I have a table called
commodities where I have
nature_of_goodscolumn in it.
nature_of_goods contains all the different types of goods like machinery, household etc.
I have another column called as
created at which contains the date and time in timestamp format.
I need to find the maximum goods took place in particular month.
I have tried the following query:
select max(mycount) from (select nature_of_goods, count(nature_of_goods) AS mycount from commodities group by month(created_at));