Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Going further with the group by
Message
 
 
To
15/09/2010 13:25:45
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Environment versions
SQL Server:
SQL Server 2008
Application:
Web
Miscellaneous
Thread ID:
01481304
Message ID:
01481310
Views:
16
>>You will need to use EXISTS criteria, e.g.
>>
>>
>>SELECT TOP 10 Event.RO_No,Min(Event.DateTime) AS LastUpdate
>> FROM Event
>> where exists (select 1 from RO where RO.Ro_No = Event.Ro_No)
>> GROUP BY Event.RO_No
>>
>>and then join with the RO the same way.
>> ORDER BY MIN(Event.Datetime
>
>Thanks, this is also another approach. I will take the one from Borislav for now. When I read it, it find it much simpler. Not sure however if it is more optimized.

I'm thinking it's most likely Boris approach will perform better, but I'd like you to do performance tests.
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform