Buy this Reference Manual in softcover from Barnes & Noble!
"Как определить наибольшее значение в столбце?"
SELECT MAX(article) AS article FROM shop +---------+ | article | +---------+ | 4 | +---------+
When you select max(date_format(col_name, "fstring")) the maximum alphabetic string is returned, not the maximum date. Need to create a temporary table to get the max date, first, then select again to format the date. Is this correct behavior?
select max(col_name), date_format (col_name, "fstring") group by col_name; This is an add workaround, but it would work. This would return the appropiate (most recent or future) datetime value as the first item and its formatted string as the second item. The biggest loss would be performance, but not too much of it.
Add your own comment.