2 ms·
Oh, it can often be worse. People sometimes try to do tricky things like running totals by relying on implicit order in SQL queries. Often they are trying to sq
by chris_wot 13y ago
Oh, it can often be worse. People sometimes try to do tricky things like running totals by relying on implicit order in SQL queries. Often they are trying to squeeze as much performance out of the database server as possible (usually SQL Server) by avoiding cursors.
My favourite ever SQL Server hack was one done by a guy called Jeff Moden, who came up with a running total update that relied on a specific quirk of SQL Server clustered indexes. The amount of effort he put into it is quite remarkable! [1]
1. (Create a temp account to check it out, they're not spammers) http://www.sqlservercentral.com/articles/T-SQL/68467/ http://www.sqlservercentral.com/articles/T-SQL/68467/