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%的数据


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM