move your case to one of the columns and then call it by reference select case...., * from ..... order by 1
Forum Rules