SELECT 1 +(SELECT count(*)FROM学生排名a WHERE a.获得的总分数〉b.获得的总分数)AS排名FROM学生排名b WHERE学生标识= '5' ORDER BY排名LIMIT 1 ;转换搜索查询
lb3vh1jj1#
使用
$this->db->query("SELECT 1 + (SELECT count( * ) FROM student_rank a WHERE a.obtained_total_mark > b.obtained_total_mark ) AS rank FROM student_rank b WHERE student_id = '5' ORDER BY rank LIMIT 1")
1条答案
按热度按时间lb3vh1jj1#
使用