Reputation: 1836
In rails 5 project with postgres I have to get most occurrence of day of week from date time field Like Log table
ID date
1 01-12-2017 //Day is Friday here
2 01-12-2017 //Day is Friday here
3 02-12-2017 //Day is Saturday here
4 02-11-2017 //Day is Thursday here
5 02-10-2017 //Day is Monday here
So the most occurred day of week is FRIDAY with count 2 against ID 1 & 2
I can group by with week of day to get such results?
Upvotes: 0
Views: 125