The Little Guy Posted May 5, 2010 Share Posted May 5, 2010 I have a time stamp column in my table, and I would like to get all the values and group them by hour I did this once, but I don't remember how I did it, anyone know how I can do this? Quote Link to comment https://forums.phpfreaks.com/topic/200753-group-by-hour/ Share on other sites More sharing options...
jskywalker Posted May 5, 2010 Share Posted May 5, 2010 if you are grouping on hour, what do you want to do with the columns you are not grouping on? if you have 1 10:02 34 2 11:34 12 3 11:36 14 5 12:02 54 what do you expect to be the result after grouping on hour? Quote Link to comment https://forums.phpfreaks.com/topic/200753-group-by-hour/#findComment-1053488 Share on other sites More sharing options...
Mchl Posted May 5, 2010 Share Posted May 5, 2010 GROUP BY HOUR(timestampColumn) ?? Quote Link to comment https://forums.phpfreaks.com/topic/200753-group-by-hour/#findComment-1053568 Share on other sites More sharing options...
fenway Posted May 5, 2010 Share Posted May 5, 2010 See here. Quote Link to comment https://forums.phpfreaks.com/topic/200753-group-by-hour/#findComment-1053617 Share on other sites More sharing options...
The Little Guy Posted May 5, 2010 Author Share Posted May 5, 2010 GROUP BY HOUR(timestampColumn) ?? Thanks! That worked! Quote Link to comment https://forums.phpfreaks.com/topic/200753-group-by-hour/#findComment-1053694 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.