1、在MySQL中,使用limit对查询的结果进行限制
如:我们查询学生表,学号为10001的学生,同时限制查询结果最多只有一个
select student_id,student_name from student where student_id=10001 limit 1
2、在Oracle中,不支持limit语法,可以使用rownum来实现同样的效果
实现上面1的效果:
select rownum,student_id,student_name from student where student_id=10001 and rownum < 2