Forum Discussion

apdidy's avatar
apdidy
Ideator I
2 years ago
Solved

Looking for equivalent of SQL select max(property) in IOM

I am looking for the equivalent to select max(property) in IOM. The below SQL query returns exactly what I want, but I understand that this should be used as a last resort and want to make sure I'm...
  • AngelaIp's avatar
    2 years ago

    Hi,

    A simple variant to replicate a MAX filter is to use orderBy + maxRecord (+select --> cause you should use it always). 

    x.setAttribute("select","item_number");
    x.setAttribute("orderBy","item_number desc"); 
    x.setAttribute("maxRecords","1");

    It should also work for the condition filter.

    Best regards

    Angela