SELECT *
FROM SY_CLASS
WHERE use_yn = 'Y'
AND class_s_cd != '****'
ORDER BY substring(class_cd,1,5) asc,sort_idx asc
