How to select date and time without the seconds in mysql?

SELECT DATE_FORMAT('2011-07-16 22:23:15', '%Y-%m-%d %H:%i');

The proper solution is zero out seconds - and - preserve data type:

SELECT `datetime` - INTERVAL EXTRACT(SECOND FROM `datetime`) SECOND
FROM `some table`

If your datetime column contains microseconds then use this variant:

SELECT `datetime` - INTERVAL EXTRACT(SECOND_MICROSECOND FROM `datetime`) SECOND_MICROSECOND
FROM `some table`

SQL Fiddle

In theory, it should be faster than examples using date formatting functions.


SELECT DATE_FORMAT(`date`, '%Y-%m-%d %H:%i') AS `formatted_date` FROM `table`;