mysql - Select the ROW having the Maximum Value of a certain Column -


for example, if query returns 2 rows or more, select row having recent date.

i'm doing this:

select * table1 name=mark , max(timestamp(date(str_to_date(date_registered,'%d/%m/%y'))))

the error returned is: #1111 - invalid use of group function

you should use order statement:

select * table1 name=mark order str_to_date(date_registered,'%d/%m/%y') desc limit 1 

Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

javascript - Get parameter of GET request -

javascript - Twitter Bootstrap - how to add some more margin between tooltip popup and element -