0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

SQLServer

Last updated at Posted at 2025-03-12
  1. 制作分页

    DECLARE @NumberOfRowsPerPage INT = 10000,
    	@PageNumber INT = 1;
    DECLARE @OffsetRowCount INT = (@PageNumber - 1) * @NumberOfRowsPerPage;
    SELECT	PersonID,
    	FirstName,
    	MiddleName,
    	LastName
    FROM	Person
    ORDER BY PersonID
       OFFSET @OffsetRowCount ROWS  
       FETCH NEXT @NumberOfRowsPerPage ROWS ONLY;  
    
  2. 删除表

    DROP TABLE 表の名前; 表を削除する
    
  3. SQL 筛选列里面有非数字内容的方法

    ISNUMERIC(查找数据的列名) = 0
    

    返回值 意义
    1 可以转换成数值型
    0 不可以转换成数值型

  4. SQL对COUNT进行筛选(HAVING)

    SELECT 列1, 列2, COUNT(*)
    FROM 表1
    GROUP BY 列1, 列2
    HAVING COUNT(*) > 1
    ORDER BY COUNT(*) DESC;
    
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?