sql语句除法
PHP 2009/4/7 18:28:33 点击:不统计
关键词:sql sql语句,sql语句中的除法,sql除法
在做网站过程中遇到了求平均数排序,不知道该怎么写sql.后来查网络得出答案
div
div在sql语句中是除的作用 得到的结果目前不清楚是什么了类型.
举例说明:select a.allhits as hits,b.*,c.pic_num from (select col_id,sum(hits) as allhits from ph_visitlog where log_date between '2009-03-31' and '2009-04-07' group by col_id) as a left join ph_collections as b on a.col_id=b.id left join (select col_id,count(id) as pic_num from ph_photos group by col_id) as c on a.col_id=c.col_id left join ph_members as d on d.id=b.member_id where d.member_period>=1239100049 and b.isopen=1 order by a.allhits div c.pic_num desc
最后一行的除法!!!
·上一篇:php中的数据类型转换 >> ·下一篇:php中获取长度 >>