select somecolumn1,somecolumn2
from stu_dept_cs
group by somecolumn1,somecolumn2,avg
having avg = min(avg)
of
with t1
(select rownumber() over (partition by somecolumn1,somecolumn2
order by somecolumn1,somecolumn2,avg asc) as rownum
from stu_dept_cs )
select * from t1 where rownum=1