Hi, there.
Normally when we do data validation, we need to retrieve some latest records. Let's take last 100 records.
Method 1 by datetime field
USE [dataDB]
go
select top 100 * from tbltransaction
order by trdate desc, trtime desc
Method 2 by running no ID field (PK)
USE [dataDB]
go
select * from tblTransaction
where ID >
( (select COUNT(*) from tblTransaction) - 150)
order by ID desc
Normally when we do data validation, we need to retrieve some latest records. Let's take last 100 records.
Method 1 by datetime field
USE [dataDB]
go
select top 100 * from tbltransaction
order by trdate desc, trtime desc
Method 2 by running no ID field (PK)
USE [dataDB]
go
select * from tblTransaction
where ID >
( (select COUNT(*) from tblTransaction) - 150)
order by ID desc
No comments:
Post a Comment