[sql] Using If else in SQL Select statement