/explore
|
You are here |
michaelerasm.us | ||
| | | | |
ctoomey.com
|
|
| | | | | ||
| | | | |
sqlserverfast.com
This is part twenty-six of the plansplaining series. And already the fourth episode about window functions. The first of those posts covered basic window functions; the second post focused on fast-track optimization for running aggregates, and the third post explained how the optimizer works around the lack of execution plan support for UNBOUNDED FOLLOWING. But... |
|
| | | | | ||
| | | | |
andreabergia.com
Window functions are an extremely powerful powerful part of the SQL 2003 standard, supported by most modern releases of databases such as Oracle 8+, Postgres 9.1+, SQL Server 2005+ and others. Sadly neither SQLLite or MySql seem to support them yet, but if you are working with a database where they are available, do use them: they can make your life a lot easier. Generally, with window functions, you can write simpler and faster code than you would without. |
|
| | | | | ||
| | | | |
andreabergia.com
As we have seen in the previous part, window functions are an usefull tool to solve a lot of SQL problems with great performances. Lets see some more tricks. LAG and LEAD revised We have already discussed the window functions LAG and LEAD. As we have said, they are used to get respectively the previous or next value in the window. What we havent mentioned is that you can not only take the previous, but also the record before (or after) it and so on. |
|
| | | |||