I just want to know it is possible to convert this line of codes in a single execute Query in Grails.
String answer = StudentAnswerData.findWhere(student: studentObject, exam: examObject)?.answer
answer.replaceAll('0','')?.size()
The code queries for a specific StudentAnswerData then counts the characters of its answer which are not zero where answer is a String composed of numeric characters (e.g. 2435000025442032030000 ).
Thanks in advance.