您当前的位置: 首页 >  sql

qq_34412985

暂无认证

  • 0浏览

    0关注

    1061博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文

sql中计算两列的差round locate convert using函数使用

qq_34412985 发布时间:2019-04-11 19:15:10 ,浏览量:0

通过子查询计算查询两列的差

convert使用按中文排序

locate类似于like 

round保留2位小数

using指定字符集using指定utf8时防止乱码

select temp. deposit,temp.prepayment,(temp.prepayment-temp. deposit)availableMoney from(select  round(ifnull(deposit,0),2)deposit,round(ifnull(prepayment,0),2)prepayment from encounter where 1=1 and (locate('哈',customer_name)>0 or locate('哈',room_no) or locate('哈',bed_no)) order by convert(customer_name using gbk) asc)temp

关注
打赏
1653291990
查看更多评论
立即登录/注册

微信扫码登录

0.0381s