MySQL : Select on timestamp column, change seconds to 00 and round minutes down to nearest 10 -


i have table timestamp column this:

2013-04-05 22:33:50

2013-04-05 22:42:03

2013-04-05 22:42:03

i want make select on , receive results seconds 00 , minutes rounded down nearest 10. as:

2013-04-05 22:30:00

2013-04-05 22:40:00

2013-04-05 22:40:00

how done? cannot update or insert on table, select.

here go:

select date_sub(date_sub(ticktick, interval mod(minute(ticktick),10) minute), interval second(ticktick) second) `table` 

Comments

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -