查询时null不要显示
表如下:
user_name user_pd
------------------------------
wang 1
wang <NULL>
我要用SELECT user_name,CONVERT(char(10), user_pd) user_pd from b 来查询
效果是:
user_name user_pd
------------------------------
wang 1
wang
------解决方案--------------------is null
------解决方案--------------------SELECT user_name,isnull(user_pd, ' ') as user_pd
from b
------解决方案----------------------如果user_pd是数字型
SELECT user_name,isnull(rtrim(user_pd), ' ') as user_pd
from b