Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
More from the grouping
Message
De
15/09/2010 18:15:54
 
 
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:
01481383
Vues:
25
>It's the same thing - adjust the inner select (derived table) only.
>
>select RO.*, E.* from RO inner JOIN
>(select top (10) Event.RO_NO, min(DateTime) as LastUpdate 
>from Event where DateTime > 'DateValue'
>and not exists (select 1 from
>Event E where DateTime <='DateValue' and E.Ro_No = Event.Ro_No)
>GROUP BY Ro_NO
>order by MIN(Event.DateTime)) E on RO.RO_NO = E.RO_NO
Actually, changing MIN() to MAX() resolves the issue. I just tested it. Out of those 2002 records, they represent in fact only 56 RO. In the RO table, there are 56 records. So, the process took 6 loops (10x5) and one last one with 6 records.

Thanks for the help
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform