In my table I have a serial number field, which is represneted by string.. It has a prefix and some numbers follow. Eg: ABC1234, ABC2345 etc. How to retrieve the largest value (max equivalent of int type) from this column. In my case it would be ABC2345. I probably could retrieve all the data,, sort it and get the same, but that would be slow.
thanks in advance..
In my table I have a serial number field, which is represneted by string..
Share
You need to utilize GORM criteria, projections in particular:
This assumes that your entity is named
MyEntityand field is namedserialNumber.