1,select Id,SongName,UpTime,TypeId,ImgPath,ClickCount,CommentCount,UserName from MV
where UserName=' + @strWhere + ' or Id in (select MvId from AddMvFav where Name=' + @strWhere + '
查询所有符合条件的用户上传的视频或者用户收藏的视频
2,case when 筛选条件
select count(*),(case when Name in(select top(3) UserName from Singer where State=1 order by Grade desc) then Name else null end) as name from AddMvFav
3,屏蔽除数为0的情况
select * from MV where IsOurSoter=1 order by case when Grade/CommentCount> 0 then Grade/CommentCount else Grade end desc