xiaopohou
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
--查找表中是否有完全重复的数据
 DECLARE @allCount INT
 DECLARE @disCount INT
  
 SET @allCount = (SELECT COUNT(*)AS allCount FROM table)
 
 SELECT DISTINCT * INTO #temp  FROM table
 SET @disCount = ( SELECT COUNT(*)AS disCount FROM #temp)
 DROP TABLE #temp
  
IF(@allCount-@disCount>0)
BEGIN
    PRINT \'Have complete same rows\'
END
ELSE   
BEGIN
    PRINT \'No complete same rows\'
END

分类:

技术点:

相关文章: