Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
A SQL challenge
Message
From
13/04/2014 13:56:25
 
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Title:
Environment versions
SQL Server:
SQL Server 2005
Application:
Web
Miscellaneous
Thread ID:
01598405
Message ID:
01598538
Views:
31
>>Hi, Naomi, just a question - for a composite sort definition in the first ORDER BY (on the OrderDate and PurchaseOrderID), to handle multiple orders in the same day where you want to grab them in succession, is the ROWS UNBOUNDED PRECEDING necessary? I was under the impression that in 2012, if ROWS UNBOUNDED wasn't specified, you'd get the behavior of UNBOUNCED PRECEDING up to the current row.
>>
>>If the ORDER BY is simply on ORDER DATE in this example, then yes, it seems it's definitely needed.
>>
>>Thanks again.
>
> I believe UNBOUND PRECEDING is the default, so I didn't need to specify it explicitly.

Well, like I said, if the definition of the ORDER BY has a unique granularity whose order you would deem chronologically sequential (i.e. a PurchaseOrderID), then I don't think it's necessary. But if the ORDER BY was just on the Order Date (a date column ), then I believe it's needed.

But aside from that, it's great that MS now has a way to implementing accumulating values that's (comparatively) less costly.
Previous
Reply
Map
View

Click here to load this message in the networking platform