Hey I have a OQL query whitch need to count a value based on a string. now I have the next query but it gives error. SELECT COUNT(CASE WHEN Check.Result = 'OK' THEN 1 END) as OK the error: Caused by: java.sql.SQLSyntaxErrorException: data type cast needed for parameter or null literal in statement
Have you tested this query in regular SQL context if it works and if it returns what you expect of? Maybe you should think about adding a subquery to your sql request.
Correct syntax should by like:
case when Result = 'OK' then count(Result) end as CountResult
group by Result