Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
maddyslayer
Yak Posting Veteran
57 Posts |
Posted - 2013-06-14 : 10:28:00
|
There is a table called "customer" where one of the columns is "date".How do i get the latest modified records from that table and the time difference between those modified records is less than or equal to 10 sec? |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2013-06-14 : 10:38:12
|
Do you mean this?SELECT *FROM( SELECT *,MAX(date) OVER () AS MaxDateFROM customer)tWHERE ABS(DATEDIFF(ss,date,MaxDate)) <=10 ------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/https://www.facebook.com/VmBlogs |
|
|
|
|
|