ALM-213 further simplify SQL