mysql分页原理和sqlserver里面序列的用法



mysql使用经验 

1.比如分页
select * from table limit 6
和select * from table limit 0,6  等价


select * from table limit 5,10;
一般前面的5放的是 漂移 后面的10放的是 一页多少行
拿到数据库 table里面的数据是 第6条到15条 


42.121.56.21

sqlserver里面序列的用法

/****** Script for SelectTopNRows command from SSMS  ******/
SELECT TOP 1000 [id]
      ,[username]
      ,[password]
      ,[telephone]
  FROM [MyWeb].[dbo].[adminusers]
  /****** Script for SelectTopNRows command from SSMS  ******/
SELECT TOP 1000 [id]
      ,[username]
      ,[password]
      ,[telephone]
  FROM [MyWeb].[dbo].[adminusers]
  create squences a;
  USE MyWeb ;
  create sequence userid;


  USE AdventureWorks2012
  insert  ibto [MyWeb].[dbo].[adminusers] values(NEXT VALUE FOR userid,'chenyu','123','13212617498');


  CREATE SCHEMA Test1;
  CREATE SEQUENCE Test1.CountBy2
    START WITH 1
    INCREMENT BY 1 ;
  GO
  SELECT NEXT VALUE FOR Test1.CountBy2 AS FirstUse;
  SELECT NEXT VALUE FOR Test.CountBy1 AS SecondUse;
  INSERT [MyWeb].[dbo].[adminusers](id,username,password,telephone)
    VALUES (NEXT VALUE FOR Test.CountBy1,'chenxuan','123','13212617498') ;
commit;


INSERT [MyWeb].[dbo].[adminusers] (id,username,password,telephone)VALUES (NEXT VALUE FOR Test1.CountBy2,'biyu','123','123456789') 


你可能感兴趣的:(mysql分页原理和sqlserver里面序列的用法)