mysql单表复杂查询
来源:互联网 发布:crash撞车影评知乎 编辑:程序博客网 时间:2024/05/19 03:47
/** * 整个考试所有小题的正确率 * @param $exam_id * @param null $begin * @param null $end * @return mixed */public function questionRightRateInExam($exam_id,$begin = null,$end = null){ $time_sql = $this->convertTimeSql($begin,$end); $data = $this->exam_record->field(' question_id,ROUND(avg(case isright when '.self::ANSWER_NOT_ANSWER.' then null else score end),2) as avg_score,sum(case isright when '.self::ANSWER_RIGHT.' then 1 else 0 end) as right_num,sum(case isright when '.self::ANSWER_WRONG.' then 1 else 0 end) as wrong_num,sum(case isright when '.self::ANSWER_NOT_ANSWER.' then 1 else 0 end) as not_answer_num ')->where(' exam_id ='.$exam_id.' AND '.$time_sql)->group(' question_id ')->order(' question_id ')->select(); $count = count($data); for($i = 0;$i<$count;$i++){ $data[$i] = $this->convertRightNum($data[$i]); } return $data;}
0 0
- mysql单表复杂查询
- SQL单表复杂查询
- Oracle单表的复杂查询
- 实验3.2 复杂的单表查询
- mysql 单表查询
- mysql单表查询
- MySQL 单表查询
- MySQL 单表查询
- MySQL-单表查询
- mysql 单表查询
- MySQL单表查询
- mysql 复杂查询
- MySQL 复杂查询
- mysql复杂查询
- MySql--复杂查询
- MySQL之复杂查询
- Mysql进行复杂查询
- Mysql进行复杂查询
- ubuntu 10.04运行cocos2d-x 3.x
- js控制只能输入数字和小数点
- WOJ--1314
- 代理传值-不同类之间参数传递
- PHP把数字ID转字母ID
- mysql单表复杂查询
- Swift Programming - A Swift Tour in Playground
- 【数据库系统概论】-关系数据库标准语言SQL(4)
- javaweb-day03-7(基础加强-泛型)
- 百度地图SDK for Android【Demo调起百度地图客户端导航功能】
- Spring MVC +JSON
- 黑马程序员——第19天——IO输入与输出(缓冲字符流,字节流,缓冲字节流,字符流、字节流总结)
- 查看登录用户
- Seperti pada foto r