dropOrderBy

fun dropOrderBy(stmt: Statement, sql: String): String(source)

Removes an ORDER BY clause that has no effect on the result of a scalar method (exists*, count*) — ordering rows the query never returns individually is pure overhead for the database. Returns the SQL unchanged when there is no ORDER BY or the statement is not a plain select.