select count( distinct display_claimId ) claimCount from qmd_richsHistory select historyId, ownerId, ownerType, linkId, linkType, batchId, batchTime, '?' keep, reference from tbl_EAI_BatchHistory with (nolock) where ownerId = 1 and ownerType = 'MFR' and linkType = 'TPC' and reference = '$RPC_1FS_Trade_DataExport' order by batchTime desc select historyId, ownerId, ownerType, linkId, linkType, batchId, batchTime, reference from tbl_EAI_BatchHistory with (nolock) where 1 = 2 and ownerId = 1 and ownerType = 'MFR' and linkType = 'TPC' and reference = '$RPC_1FS_Trade_DataExport' delete from tbl_EAI_BatchHistory where ownerId = 1 and ownerType = 'MFR' and historyId = insert into tbl_EAI_BatchHistory( ownerType, ownerId, linkType, linkId, reference, batchId, batchTime ) values ( 'MFR', 1, 'TPC', , '$RPC_1FS_Trade_DataExport', 0, ) select historyId, ownerId, ownerType, linkId, linkType, batchId, batchTime, '?' keep, reference from tbl_EAI_BatchHistory with (nolock) where ownerId = 1 and ownerType = 'MFR' and linkType = 'TPC' and reference = '$RPC_1FS_Trade_DataExport' order by batchTime desc
Deleted #lsnumberformat( _deleted )#
Added #lsnumberformat( _added )#
select linkId, max( batchTime ) lastBatchTime from qmd_deletedHistory group by linkId