[SE-411][MOD] change SQL query

Merged Felipe requested to merge SE-411 into 11.0-macro

Merge request reports