question

Ajith avatar image
Ajith asked

How to get last updated records from the record where i previously fetched last time

how to store last fetched record info in sql and how to pass the same condition in sql ? i'm having LastModifiedOn field in table
sql-server-2012sql query
3 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

ThomasRushton avatar image ThomasRushton ♦♦ commented ·
Not quite sure what you're asking for here. Can you provide a scenario?
0 Likes 0 ·
Ajith avatar image Ajith commented ·
@thomasRushton Thanks for reply.Let me explain 1 Scenario For first time i will fetch 100 records in table. 1 day later extra 10 more records will added to same table. for second time when i fetch i required only extra last 10 records from previous 100 records .For that i need to compare last record from where to fetch. So i am having LastModifiedOn field in table. Every time it must change when i execute query. can you help with query ?
0 Likes 0 ·
Sean_Smith avatar image Sean_Smith commented ·
Are you looking for just the rows with the most current "LastModifiedOn" date, or do you want any rows which are greater than the "LastModifiedOn" date from the time you last queried the data? Example: LastModifiedOn = 20170101 Query the data and get 100 rows. Then, two rows get added, one is for 20170102, and another for 20170103. You query the data again. Should your results bring back 20170102 and 20170103, or just 20170103?
0 Likes 0 ·

0 Answers

·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.