我试图像5 * log(7.5 / 2)那样做,但是我认为这是错误的方法,有人可以告诉我如何正确做吗?
答案 0 :(得分:0)
在PHP中,使用log10
而不是log
来创建以10为底的对数(这是自然对数,即以 e 为底)。另请注意,注释中的比较示例是使用 select x.category
,count(x.roomId) - case when isnull(max(booked_rooms.cnt))=1 then
0
else max(booked_rooms.cnt)
end as available_rooms
from room x
left join ( select c.category /* Find out the rooms bny category which are booked within the dates*/
,count(c.roomID) as cnt
from bookings a
join reservedRoom b
on a.bookingID=b.bookingID
join room c
on b.roomID=c.roomID
where a.checkIndate between '2018-02-08' and '2018-02-09'
group by c.category
)booked_rooms
on x.category=booked_rooms.category
group by x.category
,而不是5.7
。尝试以下方法:
7.5
输出:
echo 1+5*log10(5.7/2);