一般数据库是最好不要带用三角星之类的符号,你如何要做实现那种效果的话,最好和视图查出数据转换成三角星之类的符号,我想你是在做类似论坛 的数据操作,我也做过,这是我以前项目中用过的
create view bbsUser_view as
select 昵称=Uname,星级=case
when Upoint<10 then ''
when Upoint between 10 and 101 then '★'
when Upoint between 102 and 501 then '★★'
when Upoint between 502 and 1001 then '★★★'
when Upoint between 1002 and 2001 then '★★★★'
when Upoint between 2002 and 5001 then '★★★★★'
else '★★★★★★'
end
,积分=Upoint from bbsuser
go