原生sql转换tp5

浏览:1454 发布日期:2017/07/03 分类:ThinkPHP5专区
$a="SELECT sum(case when a.score in (4,5) then 1 else 0 end)/COUNT(a.id)*100 hpl,c.* FROM decorationeva a,projects b LEFT JOIN decoration c ON b.decorationid=c.id where a.pid=b.id GROUP BY b.decorationid ORDER BY hpl desc,c.id asc";
最佳答案
评论( 相关
后面还有条评论,点击查看>>