I am in need to use a postgres query inside an sld file. Based on the documentation, before testing the now() function, I decided to make a test with the max function. I want to style only the max value in the qtd_deteccoes property, ref to CODE 1. I retrieved the max value into the ogc:Literal tag, in other words (ogc:Literal has the value returned by the max function) and after that, I compared the value using the filter ogc:PropertyIsEqualTo. While validating the sld, GeoServer does not show any error, but I am not sure if the sld makes any sense. Could anyone give an insight to the code bellow?
<ogc:Filter>
<ogc:PropertyIsEqualTo>
<ogc:PropertyName>qtd_deteccoes</ogc:PropertyName>
<ogc:Literal>
<ogc:Function name="max">
<ogc:PropertyName>qtd_deteccoes</ogc:PropertyName>
</ogc:Function>
</ogc:Literal>
</ogc:PropertyIsEqualTo>
</ogc:Filter>
<ogc:Filter> <ogc:PropertyIsEqualTo> <ogc:PropertyName>qtd_deteccoes</ogc:PropertyName> <ogc:Literal> <ogc:Function name="max"> <ogc:PropertyName>qtd_deteccoes</ogc:PropertyName> </ogc:Function> </ogc:Literal> </ogc:PropertyIsEqualTo> </ogc:Filter>