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 -

How to get the ip address of VM and use it to configure SSH connection dynamically in Ansible -

javascript - Get parameter of GET request -