| SQL语句又有问题了
|
减小字体
增大字体
|
问题:select id,tupian,mingcheng,bianhao,case when youhuijia=0 then jiage else <font style=\text-decoration:line-through\>+jiage+</font> end as jiage,caizhi,case when youhuijia=0 then else youhuijia end as youhuijia from shangpin where id in(select shangpinid from shoucang where yonghuid=@id)错误:将 varchar 值 <font style=text-decoration:line-through> 转换为数据类型为 int 的列时发生语法我是想优惠价为0的话就只显示原价,否则把原价划掉,用时显示优惠价
else '<font style=\"text-decoration:line-through\">'+jiage+'</font>' end 改成
else '<font style=\"text-decoration:line-through\">'+cast(jiage as varchar(20)+'</font>' end
就可以了 ----------------------------------------------------------------- CONVERT 和cast功能本来就一样的.不过你只是简单转换的话..最好用cast 如果你对select id,tupian,mingcheng,bianhao,case when youhuijia=0 then jiage else <font style=\text-decoration:line-through\>+jiage+</font> end as jiage,caizhi,case when youhuijia=0 then else youhuijia end as youhuijia from shangpin where id in(select shangpinid from shoucang where yonghuid=@id)错误:将 varchar 值 <font style=text-decoration:line-through> 转换为数据类型为 int 的列时发生语法我是想优惠价为0的话就只显示原价,否则把原价划掉,用时显示优惠价这个问题有好的意见或
建议,请留言
|
|
[]
[返回上一页]
[打 印]
|
|
|