查询mysql8数据库

浏览:699 发布日期:2018/09/18 分类:ThinkPHP5专区
$fangtai_arr = db("t_wxroomstatus")->field("F_RoomType,count(*) as RoomNum,sum(case when F_RoomStatus='入住' then 0 else 1 end) as KongRoomNum,sum(case when F_RoomStatus='入住' then 1 else 0 end) as InRoomNum") ->where('F_Comkey',30000825) ->group("F_RoomType") ->select();

这里的查询数据,case when 函数,条件用到中文“入住”,会乱码,查询也会有问题,这该怎么解决
最佳答案
评论( 相关
后面还有条评论,点击查看>>