I want to extract a row, with the max value in one field but is less than a certain value of that value;
Fore example,
SELECT id,max(val) WHERE val<23
Here, I need the value of the maximum of field val but which must be less than 23. This works and gives me, the maximum values, but the id field is not respective to that field, it provides the id of the first occurence.
What is the right query?
How about: