SQL取列数函数

不同数据库有不同的函数进行取值

(1)    SQL SERVER  TOP函数

Select top(10) from student;---取student表10行数据

Select top 10 precent from student;---取student 表10%的数据

(2)    ORACLE rownum函数

Select * from student where rownum<=10; --取student表10行数据

Select * from student where rownum<=(select count(*)*0.1 from student) ;

---取student 表10%的数据

(3)    MY SQL limit 函数

Select * from student  limit 10; --取student表10行数据

Select * from student limit round(n*0.1) ---取student 表10%的数据

posted @ 2019-01-17 16:19  流离32位  阅读(1392)  评论(0)    收藏  举报