想查出成绩最高的那行数据,但是不能使用order by和limit,使用where子查询来做.

#表中的所有数据.
mysql> select * from sc;
+-----+-----+-------+
| SNO | CNO | SCORE |
+-----+-----+-------+
| 1   | K1  |    83 |
| 2   | K1  |    85 |
| 2   | K5  |    90 |
| 5   | K1  |    92 |
| 5   | K5  |    84 |
| 5   | K8  |    80 |
+-----+-----+-------+
6 rows in set (0.00 sec)

#成绩最高的分数.
mysql> select max(score) from sc;
+------------+
| max(score) |
+------------+
|         92 |
+------------+
1 row in set (0.01 sec)

#两个where子句结合起来查询.
mysql> select sno,cno,score from sc where score=(select max(score) from sc);
+-----+-----+-------+
| sno | cno | score |
+-----+-----+-------+
| 5   | K1  |    92 |
+-----+-----+-------+
1 row in set (0.01 sec)