如何使用查询构建器在(temp = str[i])
子句中编写原始表达式?
join
我尝试过以下方式实现它,但它不起作用:
SELECT
rating.post_id,
sum(rate_like),
sum(rate_dislike),
(sum(rate_like) + sum(rate_dislike)),
column_rating
from rating
inner join (
select
post_id,
round(round((((sum(rate_like) / (sum(rate_like) + sum(rate_dislike)) * 100) * 0.5) / 10) * 2) / 2, 1) as column_rating
from rating group by post_id
) as rating_table
on rating.post_id = rating_table.post_id
group by rating.post_id
答案 0 :(得分:0)
我能够使用->join(DB()->raw('select...')