Simplify sql condition normalization