mysql數(shù)據(jù)庫sql語句的正確用法
以下的文章介紹了mysql數(shù)據(jù)庫sql語句,取表中的n-m條數(shù)據(jù)的實際步驟介紹,同時也包括了一些其他常用的數(shù)據(jù)庫sql語句取相關(guān)表中的n-m條數(shù)據(jù)的實際操作,我們首先是以命題的方式來寫出我們所要表達的內(nèi)容。
命題:寫出一條Sql語句: 取出表A中第31到第40記錄(自動增長的ID作為主鍵, 注意:ID可能不是連續(xù)的。)
oracle數(shù)據(jù)庫中:
- select * from A where rownum<=40 minus select * from A where rownum<=30
sqlserver數(shù)據(jù)庫中:
- select top 10 * from A where id not in (select top 30 id from A )
- select top 10 * from A where id>(select max(id) from (select top 30 id A) as A)
mysql數(shù)據(jù)庫中:
- SELECT * FROM A LIMIT 30,40
以上的相關(guān)內(nèi)容就是對mysql數(shù)據(jù)庫的sql語句介紹,望你能有所收獲。

【編輯推薦】



















