re-capitalize IFs in SQL