Max function using where option
I am writing a query where i can get the maximum Id and its name. So iam using this option Max. But this is giving me error.
SELECT Id,Name FROM `User` WHERE Id = Max(Id);
When i submit this query iam getting error
Invalid use of group function
After this i also want query for my second largest Id i am having. Anyone help me in this issue
Have you tried something like MAX(colname.ID)? It might be using ID as the same as the current entry and having a "max" of a single value doesn't mean anything (or its irrelevant if so). Just a thought. I'm not sure about this.
Daniel - Freelance Web Design | <?php?> | <html>| Deutsch | italiano | espa˝ol | portuguŕs | catalÓ | un peu de franšais | Ninasoma Kiswahili | 日本語の学生でした。| درست العربية