Home > Database > Mysql Tutorial > mysql 求通过率 用float表示出来。求大神帮忙,急。。。

mysql 求通过率 用float表示出来。求大神帮忙,急。。。

WBOY
Release: 2016-06-06 09:43:01
Original
948 people have browsed it

mysql

select ((select COUNT(ut.status) from user_test ut where ut.userid=252 and ut.status=1)/(COUNT(ut.status))) as '考试通过率'
from user_test ut
where ut.userid=252 我求的是通过率,要怎么把select后面查询出的结果用float表示。

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template