NULL值时:select id ,isnull(name,'0') from A
空值时::select id ,replace(name,'','0') from A
取前五名:select top 5 id,name,grade from A order by grade desc
随机5条读取:select top 5 id,name,grade from A order by newid()
获取同名的信息
select id,namefrom A
where name in
(select name
from A
group by name
having count(1)>1);