Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
More from the grouping
Message
 
 
À
15/09/2010 16:48:08
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Versions des environnements
SQL Server:
SQL Server 2008
Application:
Web
Divers
Thread ID:
01481344
Message ID:
01481364
Vues:
21
>>I see, I think I have an idea.
>>
>>Do you store the LastDate processed somewhere and Pass this date to get everything up from that date?
>
>Yes, this is what we rely on. This is sent to the server for each of those10 records. I save in a related table the last LastDate. Then, once the client requests to start the process again, I send the LastUpdate value.
>
>The query can then use that LastUpdate value like this:
>
>
>SELECT RO.FirstName
>FROM (SELECT TOP 10 Event.RO_No,Min(Event.DateTime) AS LastUpdate
> FROM Event
> INNER JOIN RO ON Temp.RO_No=RO.RO_No
> WHERE Event_Log.Event_DateTime>'Something'
> GROUP BY Event.RO_No
> ORDER BY MIN(Event.Datetime)) Temp
>INNER JOIN RO ON Temp.RO_No=RO.RO_No
>
SELECT TOP 10 Event.RO_No,
Min(Event.DateTime) AS LastUpdate,
min(Ro.FirstName) as FirstName
 FROM Event
inner join RO on Event.Ro_No = RO.Ro_No
 WHERE Event.Event_DateTime>'SomDate' GROUP BY Event.RO_No
 ORDER BY MIN(Event.Datetime) 
and not exists(select 1 from Event E where E.DateTim < ='SomeDate' and E.Ro_No = RO.Ro_NO)
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform