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

ios - Realm over CoreData should I use NSFetchedResultController or a Dictionary? -

authentication - Mongodb revoke acccess to connect test database -

r - Update two sets of radiobuttons reactively - shiny -