笔记279 查看交易记录窜班的SQL语句 2013-5-24

笔记279 查看交易记录窜班的SQL语句 2013-5-24

1 --查看交易记录窜班的SQL语句 2013-5-24
2 USE [GPOSDB]
3 GO
4 --查看交易记录窜班的
5 SELECT   *  FROM [dbo].[CT_FuelingData] WHERE CONVERT(BIGINT,SUBSTRING(replace(replace(replace(CONVERT(varchar, [D_FD_DateTime], 120 ),'-',''),' ',''),':',''),1,12)) <CONVERT(BIGINT,VC_FD_GroupNo) ORDER BY [D_FD_DateTime] DESC
6 
7 --检查一下交易明细表有多少交易记录
8 SELECT COUNT(*) FROM [dbo].[CT_FuelingData]

posted @ 2013-08-04 20:48 桦仔 阅读(...) 评论(...)  编辑 收藏