笔记256 查询交易序号重复,重复扣款
笔记256 查询交易序号重复,重复扣款
1 --查询交易序号重复,重复扣款 2 USE [GPOSDB] 3 GO 4 --SELECT * FROM [dbo].[CT_FuelingData] ORDER BY [D_FD_DateTime] DESC 5 --UPDATE [dbo].[CT_FuelingData] SET [VC_FD_No]='0103121017102211' WHERE [VC_FD_No]='0103121015113630' AND [D_FD_DateTime]='2012-10-17 10:22:11' 6 7 --查询交易序号重复,重复扣款 8 SELECT [VC_FD_No] ,COUNT([VC_FD_No]) AS '重复数' FROM [dbo].[CT_FuelingData] GROUP BY [VC_FD_No] HAVING COUNT([VC_FD_No])>1