Search code examples
sap-commerce-cloud

How to fetch latest record using flexible search query?


I have two attributes A & B as below. I want to fetch latest record from each set of duplicate record's based on creation time.

I tried doing it with MAX function but flexible search is not supporting MAX function. Any help would be appreciated?

  Table : ABC

A B

100 11

100 11

100 11

200 12

200 12

300 13



 Result :

100 11

200 12

300 13

Solution

  • You can do it using max function. Please use it as given below

    SELECT max({modifiedtime}) FROM {Product}