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