SlideShare una empresa de Scribd logo
1 de 34
Descargar para leer sin conexión
SQL Server Windowing
Functions
Enrique Catalá Bañuls
Mentor, SolidQ
MAP 2012 – Microsoft Technical Ranger – Microsoft Certified Trainer
ecatala@solidq.com
Twitter: @enriquecatala
© 2012 SolidQ
Enrique Catalá Bañuls
•Computer engineer
•Mentor at SolidQ in the relational engine team
•Microsoft Technical Ranger
•Microsoft Active Professional
•Microsoft Certified Trainer
© 2012 SolidQ
ecatala@solidq.com
Twitter: @enriquecatala
3© 2012 SolidQ
About SolidQ…
• SolidQ sets the standard for information management services by providing the world's
most trusted and reliable business intelligence, data management, collaboration and custom
solutions for Microsoft's cloud and on-premise platforms. SolidQ is recognized as an expert
among its peers:
• 80 of the world’s top information experts in our BI and data management
team, including more than 30 SQL MVPs
• Authored over 30 industry leading books
• Frequent speakers at local and international SQL Server technical
conferences such as TechEd around the world, the BI Conference, SQL PASS
Summit, and SQL Saturdays
• Serving over 800 clients in 22 countries
• We are so confident in the capabilities of our team and the value we
provide, we unconditionally guarantee your satisfaction with our services.
• For more information visit www.solidq.com
SolidQTM Journal
• Free, monthly e-magazine providing answers you need to be successful with
your Microsoft SQL Server, Business Intelligence, and software development
solutions
• Featuring in-depth technical articles, real-life case studies, practical columns,
and seasoned perspectives from our lineup of influential global experts—
both inside SolidQ and around the community
• Helping busy IT pros make the best decisions about which technologies to
use when and where, how to get the most out of their systems, and how to
be more productive and effective in their organizations
• Read today at www.solidq.com/sqj
Real Practices for
the Real World
© 2012 SolidQ – Think fast, move fast 4
Objectives of this session
•Introduction
•The past, the present and the future
•Window Functions
• Why do we need window functions?
• Syntax
• Performance
• Why almost complete?
•Q&A
5 |© 2012 SolidQ
Window Functions
•Window function
• function applied to a set of rows defined by a window
descriptor and returns a single value for each row
from the underlying query
•Window descriptor
• Define which rows will be used with the function
© 2012 SolidQ
Objectives of this session
•Introduction
•The past, the present and the future
•Window Functions
• Why do we need window functions?
• Syntax
• Performance
• Why almost complete?
•Q&A
7 |© 2012 SolidQ
The past, the present and the future
•The SQL 2000 way
• SQL Server 2000 does not provide any syntax to
support windowing functions
•The SQL 2005 way
• SQL Server 2005 to 2008R2 introduced a partial
implementation of the windowing functions using the
OVER clause
•The SQL 2012 way
• SQL Server 2012 will have an almost complete
implementation of the windowing functions
© 2012 SolidQ
The SQL 2005-2008R2 way
•SQL Server 2005 introduces
• OVER clause (partially implemented)
• New window functions
o ROW_NUMBER()
o RANK()
o DENSE_RANK()
o NTILE()
•SQL Server 2008/2008R2 added no new
implementations in this particular area
© 2012 SolidQ
The SQL 2005-2008R2 way
•OVER clause
•Two different implementations depending on
type of windowing
• Aggregate window functions does not provide the
ORDER BY clause
© 2012 SolidQ
The SQL 2012 way
• SQL Server 2012 are getting close to the full
implementation of Windowing functions
• SQL Server 2012 introduces:
• OVER clause almost complete
o Order by
o Window Frame
• 8 new window functions
o LAG(), LEAD()
o FIRST_VALUE(), LAST_VALUE()
o CUME_DIST()
o PERCENT_RANK()
o PERCENTILE_DISC(), PERCENTILE_COUNT()
© 2012 SolidQ
OVER clause syntax
•SQL Server 2005/2008/R2
• SQL Server 2012
© 2012 SolidQ
Objectives of this session
•Introduction
•The past, the present and the future
•Window Functions
• Why do we need window functions?
• Syntax
• Performance
• Why almost complete?
•Q&A
13 |© 2012 SolidQ
Why do we need windows functions?
• Why do we need windows functions?
• What if we want to get the sum and the value
column? (group and detail)
• If we are in SQL 2005/2008/2008R2…am i correct with
this approach?
select id_table, value,
sum(value) as [sum(value)]
from table1 group by id_table
Msg 8120, Level 16, State 1, Line 1
Column 'table1.value' is invalid in the select list because
it is not contained in either an aggregate function or the
GROUP BY clause.
id_table value
1 1
2 1
2 2
3 1
3 2
3 3
SUM(value)
1
3
6
id_table value sum(value)
1 1 1
2 1 3
2 2 3
3 1 6
3 2 6
3 3 6
Select sum(value) as [sum(value)]
from table1 group by id_table
© 2012 SolidQ
Why do we need windows functions?
•Now we know that the OVER clause exists…
•This must be our solution
select id_table,
value,
sum(value) over(partition by id_table)
from table1
id_table value sum(value)
1 1 1
2 1 3
2 2 3
3 1 6
3 2 6
3 3 6
© 2012 SolidQ
New syntax to solve old
problems
• Partitioning
• Ordering
• Slicing/framing
© 2012 SolidQ
Key concepts: All together
Partition
UNBOUNDED
FOLLOWING
UNBOUNDED
PRECEDING
CURRENT
ROW
© 2012 SolidQ
Key concepts
© 2012 SolidQ
Key concepts: Partition
•Partition is like a group of
rows with similar
“characteristics” inside a set
© 2012 SolidQ
Key concepts: Partition
•Partition is like a group of
rows with similar
“characteristics” inside a set
© 2012 SolidQ
Key concepts: Slicing/Framing
• RANGE/ROWS
• ROWS | RANGE BETWEEN <B1> AND <B2>
• ROWS | RANGE <B1>
© 2012 SolidQ
Key concepts: Slicing/Framing
• B1 and B2 can be
• UNBOUNDED PRECEDING
• UNBOUNDED FOLLOWING
• CURRENT ROW
• For “ROWS” clause only
o <scalar expression> PRECEDING
o <sclara expression> FOLLOWING
• Note
• B1 <= B2 or NULL will be returned
o Except in COUNT() that 0 will be returned
© 2012 SolidQ
Key concepts: All together
Partition
UNBOUNDED
FOLLOWING
UNBOUNDED
PRECEDING
CURRENT
ROW
© 2012 SolidQ
New windowing functions
• New analytic functions in SQL 2012
• offset
• LAG()
• LEAD()
• FIRST_VALUE()
• LAST_VALUE()
• Distribution
• PERCENT_RANK()
• CUME_DIST()
• PERCENTILE_CONT()
• PERCENTILE_DIST()
© 2012 SolidQ
DEMO 1: NEW FUNCTIONS
AND SYNTAX
Basics on framing, RANGE vs ROWS, new window functions
© 2012 SolidQ
Objectives of this session
•Introduction
•The past, the present and the future
•Window Functions
• Why do we need window functions?
• Syntax
• Performance
• Why almost complete?
•Q&A
26 |© 2012 SolidQ
Objectives of this session
•Introduction
•The past, the present and the future
•Window Functions
• Why do we need window functions?
• Syntax
• Performance
• Why almost complete?
•Q&A
27 |© 2012 SolidQ
Performance: IN-MEMORY vs ON
DISK
• Directly affected by Window Spool Operator
• Used to store the framing data
• In-memory vs disk-based worktable
• In-memory worktable
• Fastest
• Prerequisites: Framing defined using ROWS and working
with <10k rows
• Disk-based worktable
• Default
• Used when the window was defined using RANGE
• Used when the windows was defined using ROWS and the
frame has more than 10k rows
© 2012 SolidQ
Performance: Indexing
•Index order by the window partitioning
elements and then by the order elements
•Include the rest of the columns
•Optimized execution operators:
1. Scan
2. Segment
3. Window spool
4. Aggregate
© 2012 SolidQ
© 2012 SolidQ
DEMO 2: PERFORMANCE
Running Totals, in memory vs on disk, …
© 2012 SolidQ
Why almost complete?
• RANGE only supports
• UNBOUNDED PRECEDING
• UNBOUNDED FOLLOWING
• CURRENT ROW
• Ranking functions does not support framing:
• ROW_NUMBER, RANK, NTILE,DENSE_RANK,
PERCENTILE_DIST, PERCENTILE_CONT
• Not implemented
• WINDOW aliases
• Clauses: NULLs FIRST and NULLs LAST
© 2012 SolidQ
Objectives of this session
•Introduction
•The past, the present and the future
•Window Functions
• Why do we need window functions?
• Syntax
• Performance
• Why almost complete?
•Q&A
32 |
THANK YOU!
Enrique Catalá Bañuls
Mentor, SolidQ
MAP 2012 – Microsoft Technical Ranger – Microsoft Certified Trainer
ecatala@solidq.com
Twitter: @enriquecatala
Sql server windowing functions

Más contenido relacionado

La actualidad más candente

SQL Tutorial - Basic Commands
SQL Tutorial - Basic CommandsSQL Tutorial - Basic Commands
SQL Tutorial - Basic Commands1keydata
 
PL/SQL Fundamentals I
PL/SQL Fundamentals IPL/SQL Fundamentals I
PL/SQL Fundamentals INick Buytaert
 
Introduction of sql server indexing
Introduction of sql server indexingIntroduction of sql server indexing
Introduction of sql server indexingMahabubur Rahaman
 
SQL select statement and functions
SQL select statement and functionsSQL select statement and functions
SQL select statement and functionsVikas Gupta
 
The oracle database architecture
The oracle database architectureThe oracle database architecture
The oracle database architectureAkash Pramanik
 
Sub query example with advantage and disadvantages
Sub query example with advantage and disadvantagesSub query example with advantage and disadvantages
Sub query example with advantage and disadvantagesSarfaraz Ghanta
 
Sql queries presentation
Sql queries presentationSql queries presentation
Sql queries presentationNITISH KUMAR
 
1 - Introduction to PL/SQL
1 - Introduction to PL/SQL1 - Introduction to PL/SQL
1 - Introduction to PL/SQLrehaniltifat
 
Indexing the MySQL Index: Key to performance tuning
Indexing the MySQL Index: Key to performance tuningIndexing the MySQL Index: Key to performance tuning
Indexing the MySQL Index: Key to performance tuningOSSCube
 

La actualidad más candente (20)

SQL Tutorial - Basic Commands
SQL Tutorial - Basic CommandsSQL Tutorial - Basic Commands
SQL Tutorial - Basic Commands
 
Sql
SqlSql
Sql
 
PL/SQL Fundamentals I
PL/SQL Fundamentals IPL/SQL Fundamentals I
PL/SQL Fundamentals I
 
MySQL Basics
MySQL BasicsMySQL Basics
MySQL Basics
 
Introduction of sql server indexing
Introduction of sql server indexingIntroduction of sql server indexing
Introduction of sql server indexing
 
SQL select statement and functions
SQL select statement and functionsSQL select statement and functions
SQL select statement and functions
 
The oracle database architecture
The oracle database architectureThe oracle database architecture
The oracle database architecture
 
SQL Basics
SQL BasicsSQL Basics
SQL Basics
 
Sql subquery
Sql  subquerySql  subquery
Sql subquery
 
SQL
SQLSQL
SQL
 
Sequences and indexes
Sequences and indexesSequences and indexes
Sequences and indexes
 
Sub query example with advantage and disadvantages
Sub query example with advantage and disadvantagesSub query example with advantage and disadvantages
Sub query example with advantage and disadvantages
 
Sql views
Sql viewsSql views
Sql views
 
MySQL Data types
MySQL Data typesMySQL Data types
MySQL Data types
 
Sql queries presentation
Sql queries presentationSql queries presentation
Sql queries presentation
 
1 - Introduction to PL/SQL
1 - Introduction to PL/SQL1 - Introduction to PL/SQL
1 - Introduction to PL/SQL
 
SQL subquery
SQL subquerySQL subquery
SQL subquery
 
Basic SQL and History
 Basic SQL and History Basic SQL and History
Basic SQL and History
 
SQL JOIN
SQL JOINSQL JOIN
SQL JOIN
 
Indexing the MySQL Index: Key to performance tuning
Indexing the MySQL Index: Key to performance tuningIndexing the MySQL Index: Key to performance tuning
Indexing the MySQL Index: Key to performance tuning
 

Destacado

A Window into Your Data: T-SQL Window Functions
A Window into Your Data: T-SQL Window FunctionsA Window into Your Data: T-SQL Window Functions
A Window into Your Data: T-SQL Window FunctionsSteve Hughes
 
Mastering T-SQL Window Functions
Mastering T-SQL Window FunctionsMastering T-SQL Window Functions
Mastering T-SQL Window FunctionsJose Rivera Miranda
 
Fast transition to sql server 2012 from mssql 2005 2008 for developers - Dav...
Fast transition to sql server 2012 from mssql 2005 2008 for  developers - Dav...Fast transition to sql server 2012 from mssql 2005 2008 for  developers - Dav...
Fast transition to sql server 2012 from mssql 2005 2008 for developers - Dav...sqlserver.co.il
 
Window functions in MariaDB 10.2
Window functions in MariaDB 10.2Window functions in MariaDB 10.2
Window functions in MariaDB 10.2Sergey Petrunya
 
Common Table Expressions in MariaDB 10.2 (Percona Live Amsterdam 2016)
Common Table Expressions in MariaDB 10.2 (Percona Live Amsterdam 2016)Common Table Expressions in MariaDB 10.2 (Percona Live Amsterdam 2016)
Common Table Expressions in MariaDB 10.2 (Percona Live Amsterdam 2016)Sergey Petrunya
 
Exploring Advanced SQL Techniques Using Analytic Functions
Exploring Advanced SQL Techniques Using Analytic FunctionsExploring Advanced SQL Techniques Using Analytic Functions
Exploring Advanced SQL Techniques Using Analytic FunctionsZohar Elkayam
 
SQL Server - Constraints
SQL Server - ConstraintsSQL Server - Constraints
SQL Server - ConstraintsAaron Buma
 
New T-SQL Features in SQL Server 2012
New T-SQL Features in SQL Server 2012 New T-SQL Features in SQL Server 2012
New T-SQL Features in SQL Server 2012 Richie Rump
 
Exploring Advanced SQL Techniques Using Analytic Functions
Exploring Advanced SQL Techniques Using Analytic FunctionsExploring Advanced SQL Techniques Using Analytic Functions
Exploring Advanced SQL Techniques Using Analytic FunctionsZohar Elkayam
 
10 SQL Tricks that You Didn't Think Were Possible
10 SQL Tricks that You Didn't Think Were Possible10 SQL Tricks that You Didn't Think Were Possible
10 SQL Tricks that You Didn't Think Were PossibleLukas Eder
 

Destacado (11)

SQL Windowing
SQL WindowingSQL Windowing
SQL Windowing
 
A Window into Your Data: T-SQL Window Functions
A Window into Your Data: T-SQL Window FunctionsA Window into Your Data: T-SQL Window Functions
A Window into Your Data: T-SQL Window Functions
 
Mastering T-SQL Window Functions
Mastering T-SQL Window FunctionsMastering T-SQL Window Functions
Mastering T-SQL Window Functions
 
Fast transition to sql server 2012 from mssql 2005 2008 for developers - Dav...
Fast transition to sql server 2012 from mssql 2005 2008 for  developers - Dav...Fast transition to sql server 2012 from mssql 2005 2008 for  developers - Dav...
Fast transition to sql server 2012 from mssql 2005 2008 for developers - Dav...
 
Window functions in MariaDB 10.2
Window functions in MariaDB 10.2Window functions in MariaDB 10.2
Window functions in MariaDB 10.2
 
Common Table Expressions in MariaDB 10.2 (Percona Live Amsterdam 2016)
Common Table Expressions in MariaDB 10.2 (Percona Live Amsterdam 2016)Common Table Expressions in MariaDB 10.2 (Percona Live Amsterdam 2016)
Common Table Expressions in MariaDB 10.2 (Percona Live Amsterdam 2016)
 
Exploring Advanced SQL Techniques Using Analytic Functions
Exploring Advanced SQL Techniques Using Analytic FunctionsExploring Advanced SQL Techniques Using Analytic Functions
Exploring Advanced SQL Techniques Using Analytic Functions
 
SQL Server - Constraints
SQL Server - ConstraintsSQL Server - Constraints
SQL Server - Constraints
 
New T-SQL Features in SQL Server 2012
New T-SQL Features in SQL Server 2012 New T-SQL Features in SQL Server 2012
New T-SQL Features in SQL Server 2012
 
Exploring Advanced SQL Techniques Using Analytic Functions
Exploring Advanced SQL Techniques Using Analytic FunctionsExploring Advanced SQL Techniques Using Analytic Functions
Exploring Advanced SQL Techniques Using Analytic Functions
 
10 SQL Tricks that You Didn't Think Were Possible
10 SQL Tricks that You Didn't Think Were Possible10 SQL Tricks that You Didn't Think Were Possible
10 SQL Tricks that You Didn't Think Were Possible
 

Similar a Sql server windowing functions

SQL Server Workshop for Developers - Visual Studio Live! NY 2012
SQL Server Workshop for Developers - Visual Studio Live! NY 2012SQL Server Workshop for Developers - Visual Studio Live! NY 2012
SQL Server Workshop for Developers - Visual Studio Live! NY 2012Andrew Brust
 
Directions NA Choosing the best possible Azure platform for NAV
Directions NA Choosing the best possible Azure platform for NAVDirections NA Choosing the best possible Azure platform for NAV
Directions NA Choosing the best possible Azure platform for NAVAleksandar Totovic
 
Sage Summit 2013: Sage 300 ERP Diagnostic Tools
Sage Summit 2013: Sage 300 ERP Diagnostic ToolsSage Summit 2013: Sage 300 ERP Diagnostic Tools
Sage Summit 2013: Sage 300 ERP Diagnostic ToolsSage 300 ERP CS
 
Automation & Cloud Evolution - Long View VMware Forum Calgary January 21 2014
Automation & Cloud Evolution - Long View VMware Forum Calgary January 21 2014Automation & Cloud Evolution - Long View VMware Forum Calgary January 21 2014
Automation & Cloud Evolution - Long View VMware Forum Calgary January 21 2014James Charter
 
JAVA_PLSQL_(9 years)_resume
JAVA_PLSQL_(9 years)_resumeJAVA_PLSQL_(9 years)_resume
JAVA_PLSQL_(9 years)_resumesumanta banerjee
 
SAP ABAP Online Training
SAP ABAP Online TrainingSAP ABAP Online Training
SAP ABAP Online TrainingNagendra Kumar
 
New in Visual Studio and TFS 2013
New in Visual Studio and TFS 2013New in Visual Studio and TFS 2013
New in Visual Studio and TFS 2013Tung Nguyen Thanh
 
Performance dreams of sql server 2014
Performance dreams of sql server 2014Performance dreams of sql server 2014
Performance dreams of sql server 2014Shehap Elnagar
 
Simplifying MySQL, Pre-FOSDEM MySQL Days, Brussels, January 30, 2020.
Simplifying MySQL, Pre-FOSDEM MySQL Days, Brussels, January 30, 2020.Simplifying MySQL, Pre-FOSDEM MySQL Days, Brussels, January 30, 2020.
Simplifying MySQL, Pre-FOSDEM MySQL Days, Brussels, January 30, 2020.Geir Høydalsvik
 
Optimizing Access with SQL Server
Optimizing Access with SQL ServerOptimizing Access with SQL Server
Optimizing Access with SQL ServerPRPASS Chapter
 
What's New in Oracle BI for Developers
What's New in Oracle BI for DevelopersWhat's New in Oracle BI for Developers
What's New in Oracle BI for DevelopersDatavail
 
Sql developer - Powerful Free tool for Developers and DBA's
Sql developer - Powerful Free tool for Developers and DBA'sSql developer - Powerful Free tool for Developers and DBA's
Sql developer - Powerful Free tool for Developers and DBA'sNavneet Upneja
 
OOW15 - Standards-Based Desktop Integration in Oracle E-Business Suite
OOW15 - Standards-Based Desktop Integration in Oracle E-Business SuiteOOW15 - Standards-Based Desktop Integration in Oracle E-Business Suite
OOW15 - Standards-Based Desktop Integration in Oracle E-Business Suitevasuballa
 

Similar a Sql server windowing functions (20)

Using T-SQL
Using T-SQL Using T-SQL
Using T-SQL
 
SQL Server Workshop for Developers - Visual Studio Live! NY 2012
SQL Server Workshop for Developers - Visual Studio Live! NY 2012SQL Server Workshop for Developers - Visual Studio Live! NY 2012
SQL Server Workshop for Developers - Visual Studio Live! NY 2012
 
Plantilla oracle
Plantilla oraclePlantilla oracle
Plantilla oracle
 
Directions NA Choosing the best possible Azure platform for NAV
Directions NA Choosing the best possible Azure platform for NAVDirections NA Choosing the best possible Azure platform for NAV
Directions NA Choosing the best possible Azure platform for NAV
 
ow.ppt
ow.pptow.ppt
ow.ppt
 
ow.ppt
ow.pptow.ppt
ow.ppt
 
Ow
OwOw
Ow
 
Sage Summit 2013: Sage 300 ERP Diagnostic Tools
Sage Summit 2013: Sage 300 ERP Diagnostic ToolsSage Summit 2013: Sage 300 ERP Diagnostic Tools
Sage Summit 2013: Sage 300 ERP Diagnostic Tools
 
Automation & Cloud Evolution - Long View VMware Forum Calgary January 21 2014
Automation & Cloud Evolution - Long View VMware Forum Calgary January 21 2014Automation & Cloud Evolution - Long View VMware Forum Calgary January 21 2014
Automation & Cloud Evolution - Long View VMware Forum Calgary January 21 2014
 
JAVA_PLSQL_(9 years)_resume
JAVA_PLSQL_(9 years)_resumeJAVA_PLSQL_(9 years)_resume
JAVA_PLSQL_(9 years)_resume
 
SAP ABAP Online Training
SAP ABAP Online TrainingSAP ABAP Online Training
SAP ABAP Online Training
 
Hello my name is DAX
Hello my name is DAXHello my name is DAX
Hello my name is DAX
 
New in Visual Studio and TFS 2013
New in Visual Studio and TFS 2013New in Visual Studio and TFS 2013
New in Visual Studio and TFS 2013
 
Performance dreams of sql server 2014
Performance dreams of sql server 2014Performance dreams of sql server 2014
Performance dreams of sql server 2014
 
SAP ABAP Online Training
SAP ABAP Online TrainingSAP ABAP Online Training
SAP ABAP Online Training
 
Simplifying MySQL, Pre-FOSDEM MySQL Days, Brussels, January 30, 2020.
Simplifying MySQL, Pre-FOSDEM MySQL Days, Brussels, January 30, 2020.Simplifying MySQL, Pre-FOSDEM MySQL Days, Brussels, January 30, 2020.
Simplifying MySQL, Pre-FOSDEM MySQL Days, Brussels, January 30, 2020.
 
Optimizing Access with SQL Server
Optimizing Access with SQL ServerOptimizing Access with SQL Server
Optimizing Access with SQL Server
 
What's New in Oracle BI for Developers
What's New in Oracle BI for DevelopersWhat's New in Oracle BI for Developers
What's New in Oracle BI for Developers
 
Sql developer - Powerful Free tool for Developers and DBA's
Sql developer - Powerful Free tool for Developers and DBA'sSql developer - Powerful Free tool for Developers and DBA's
Sql developer - Powerful Free tool for Developers and DBA's
 
OOW15 - Standards-Based Desktop Integration in Oracle E-Business Suite
OOW15 - Standards-Based Desktop Integration in Oracle E-Business SuiteOOW15 - Standards-Based Desktop Integration in Oracle E-Business Suite
OOW15 - Standards-Based Desktop Integration in Oracle E-Business Suite
 

Más de Enrique Catala Bañuls

Sql server ha muerto, larga vida a sql server
Sql server ha muerto, larga vida a sql serverSql server ha muerto, larga vida a sql server
Sql server ha muerto, larga vida a sql serverEnrique Catala Bañuls
 
Capas de acceso a datos .net escalables de verdad contra SQL Server
Capas de acceso a datos .net escalables de verdad contra SQL ServerCapas de acceso a datos .net escalables de verdad contra SQL Server
Capas de acceso a datos .net escalables de verdad contra SQL ServerEnrique Catala Bañuls
 
Aplicando R al análisis de rendimiento de un servidor
Aplicando R al análisis de rendimiento de un servidorAplicando R al análisis de rendimiento de un servidor
Aplicando R al análisis de rendimiento de un servidorEnrique Catala Bañuls
 
Técnicas avanzadas para resolver tus problemas de sql server
Técnicas avanzadas para resolver tus problemas de sql serverTécnicas avanzadas para resolver tus problemas de sql server
Técnicas avanzadas para resolver tus problemas de sql serverEnrique Catala Bañuls
 
Capas de acceso a datos .NET escalables de verdad: el batido perfecto para el...
Capas de acceso a datos .NET escalables de verdad: el batido perfecto para el...Capas de acceso a datos .NET escalables de verdad: el batido perfecto para el...
Capas de acceso a datos .NET escalables de verdad: el batido perfecto para el...Enrique Catala Bañuls
 
Planes de ejecución 3.0 sql 2016 y v next
Planes de ejecución 3.0 sql 2016 y v nextPlanes de ejecución 3.0 sql 2016 y v next
Planes de ejecución 3.0 sql 2016 y v nextEnrique Catala Bañuls
 
Aplicando R al análisis de rendimiento de un servidor
Aplicando R al análisis de rendimiento de un servidorAplicando R al análisis de rendimiento de un servidor
Aplicando R al análisis de rendimiento de un servidorEnrique Catala Bañuls
 
Sql server 2016 novedades para desarrolladores
Sql server 2016 novedades para desarrolladoresSql server 2016 novedades para desarrolladores
Sql server 2016 novedades para desarrolladoresEnrique Catala Bañuls
 
Dawarehouse como servicio en azure (sqldw)
Dawarehouse como servicio en azure (sqldw)Dawarehouse como servicio en azure (sqldw)
Dawarehouse como servicio en azure (sqldw)Enrique Catala Bañuls
 
Datawarehouse como servicio en azure (sqldw)
Datawarehouse como servicio en azure (sqldw)Datawarehouse como servicio en azure (sqldw)
Datawarehouse como servicio en azure (sqldw)Enrique Catala Bañuls
 
Como hacer tuning a capas de acceso a datos en .NET (dotNetConference2016)
Como hacer tuning a capas de acceso a datos en .NET (dotNetConference2016)Como hacer tuning a capas de acceso a datos en .NET (dotNetConference2016)
Como hacer tuning a capas de acceso a datos en .NET (dotNetConference2016)Enrique Catala Bañuls
 
Como leer planes de ejecución - edición 2015
Como leer planes de ejecución - edición 2015Como leer planes de ejecución - edición 2015
Como leer planes de ejecución - edición 2015Enrique Catala Bañuls
 

Más de Enrique Catala Bañuls (20)

Sql server ha muerto, larga vida a sql server
Sql server ha muerto, larga vida a sql serverSql server ha muerto, larga vida a sql server
Sql server ha muerto, larga vida a sql server
 
Capas de acceso a datos .net escalables de verdad contra SQL Server
Capas de acceso a datos .net escalables de verdad contra SQL ServerCapas de acceso a datos .net escalables de verdad contra SQL Server
Capas de acceso a datos .net escalables de verdad contra SQL Server
 
Paralelismo en SQL Server
Paralelismo en SQL ServerParalelismo en SQL Server
Paralelismo en SQL Server
 
Aplicando R al análisis de rendimiento de un servidor
Aplicando R al análisis de rendimiento de un servidorAplicando R al análisis de rendimiento de un servidor
Aplicando R al análisis de rendimiento de un servidor
 
Técnicas avanzadas para resolver tus problemas de sql server
Técnicas avanzadas para resolver tus problemas de sql serverTécnicas avanzadas para resolver tus problemas de sql server
Técnicas avanzadas para resolver tus problemas de sql server
 
Capas de acceso a datos .NET escalables de verdad: el batido perfecto para el...
Capas de acceso a datos .NET escalables de verdad: el batido perfecto para el...Capas de acceso a datos .NET escalables de verdad: el batido perfecto para el...
Capas de acceso a datos .NET escalables de verdad: el batido perfecto para el...
 
Planes de ejecución 3.0 sql 2016 y v next
Planes de ejecución 3.0 sql 2016 y v nextPlanes de ejecución 3.0 sql 2016 y v next
Planes de ejecución 3.0 sql 2016 y v next
 
Paralelismo en sql server
Paralelismo en sql serverParalelismo en sql server
Paralelismo en sql server
 
Aplicando R al análisis de rendimiento de un servidor
Aplicando R al análisis de rendimiento de un servidorAplicando R al análisis de rendimiento de un servidor
Aplicando R al análisis de rendimiento de un servidor
 
Query store
Query storeQuery store
Query store
 
Planes de ejecucion 2016
Planes de ejecucion 2016Planes de ejecucion 2016
Planes de ejecucion 2016
 
Sql server 2016 novedades para desarrolladores
Sql server 2016 novedades para desarrolladoresSql server 2016 novedades para desarrolladores
Sql server 2016 novedades para desarrolladores
 
Dawarehouse como servicio en azure (sqldw)
Dawarehouse como servicio en azure (sqldw)Dawarehouse como servicio en azure (sqldw)
Dawarehouse como servicio en azure (sqldw)
 
Query store
Query storeQuery store
Query store
 
Planes de ejecucion 2
Planes de ejecucion 2Planes de ejecucion 2
Planes de ejecucion 2
 
Planes de ejecucion 1
Planes de ejecucion 1Planes de ejecucion 1
Planes de ejecucion 1
 
Migración a sql server 2016
Migración a sql server 2016Migración a sql server 2016
Migración a sql server 2016
 
Datawarehouse como servicio en azure (sqldw)
Datawarehouse como servicio en azure (sqldw)Datawarehouse como servicio en azure (sqldw)
Datawarehouse como servicio en azure (sqldw)
 
Como hacer tuning a capas de acceso a datos en .NET (dotNetConference2016)
Como hacer tuning a capas de acceso a datos en .NET (dotNetConference2016)Como hacer tuning a capas de acceso a datos en .NET (dotNetConference2016)
Como hacer tuning a capas de acceso a datos en .NET (dotNetConference2016)
 
Como leer planes de ejecución - edición 2015
Como leer planes de ejecución - edición 2015Como leer planes de ejecución - edición 2015
Como leer planes de ejecución - edición 2015
 

Último

[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 

Último (20)

[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 

Sql server windowing functions

  • 1. SQL Server Windowing Functions Enrique Catalá Bañuls Mentor, SolidQ MAP 2012 – Microsoft Technical Ranger – Microsoft Certified Trainer ecatala@solidq.com Twitter: @enriquecatala © 2012 SolidQ
  • 2. Enrique Catalá Bañuls •Computer engineer •Mentor at SolidQ in the relational engine team •Microsoft Technical Ranger •Microsoft Active Professional •Microsoft Certified Trainer © 2012 SolidQ ecatala@solidq.com Twitter: @enriquecatala
  • 3. 3© 2012 SolidQ About SolidQ… • SolidQ sets the standard for information management services by providing the world's most trusted and reliable business intelligence, data management, collaboration and custom solutions for Microsoft's cloud and on-premise platforms. SolidQ is recognized as an expert among its peers: • 80 of the world’s top information experts in our BI and data management team, including more than 30 SQL MVPs • Authored over 30 industry leading books • Frequent speakers at local and international SQL Server technical conferences such as TechEd around the world, the BI Conference, SQL PASS Summit, and SQL Saturdays • Serving over 800 clients in 22 countries • We are so confident in the capabilities of our team and the value we provide, we unconditionally guarantee your satisfaction with our services. • For more information visit www.solidq.com
  • 4. SolidQTM Journal • Free, monthly e-magazine providing answers you need to be successful with your Microsoft SQL Server, Business Intelligence, and software development solutions • Featuring in-depth technical articles, real-life case studies, practical columns, and seasoned perspectives from our lineup of influential global experts— both inside SolidQ and around the community • Helping busy IT pros make the best decisions about which technologies to use when and where, how to get the most out of their systems, and how to be more productive and effective in their organizations • Read today at www.solidq.com/sqj Real Practices for the Real World © 2012 SolidQ – Think fast, move fast 4
  • 5. Objectives of this session •Introduction •The past, the present and the future •Window Functions • Why do we need window functions? • Syntax • Performance • Why almost complete? •Q&A 5 |© 2012 SolidQ
  • 6. Window Functions •Window function • function applied to a set of rows defined by a window descriptor and returns a single value for each row from the underlying query •Window descriptor • Define which rows will be used with the function © 2012 SolidQ
  • 7. Objectives of this session •Introduction •The past, the present and the future •Window Functions • Why do we need window functions? • Syntax • Performance • Why almost complete? •Q&A 7 |© 2012 SolidQ
  • 8. The past, the present and the future •The SQL 2000 way • SQL Server 2000 does not provide any syntax to support windowing functions •The SQL 2005 way • SQL Server 2005 to 2008R2 introduced a partial implementation of the windowing functions using the OVER clause •The SQL 2012 way • SQL Server 2012 will have an almost complete implementation of the windowing functions © 2012 SolidQ
  • 9. The SQL 2005-2008R2 way •SQL Server 2005 introduces • OVER clause (partially implemented) • New window functions o ROW_NUMBER() o RANK() o DENSE_RANK() o NTILE() •SQL Server 2008/2008R2 added no new implementations in this particular area © 2012 SolidQ
  • 10. The SQL 2005-2008R2 way •OVER clause •Two different implementations depending on type of windowing • Aggregate window functions does not provide the ORDER BY clause © 2012 SolidQ
  • 11. The SQL 2012 way • SQL Server 2012 are getting close to the full implementation of Windowing functions • SQL Server 2012 introduces: • OVER clause almost complete o Order by o Window Frame • 8 new window functions o LAG(), LEAD() o FIRST_VALUE(), LAST_VALUE() o CUME_DIST() o PERCENT_RANK() o PERCENTILE_DISC(), PERCENTILE_COUNT() © 2012 SolidQ
  • 12. OVER clause syntax •SQL Server 2005/2008/R2 • SQL Server 2012 © 2012 SolidQ
  • 13. Objectives of this session •Introduction •The past, the present and the future •Window Functions • Why do we need window functions? • Syntax • Performance • Why almost complete? •Q&A 13 |© 2012 SolidQ
  • 14. Why do we need windows functions? • Why do we need windows functions? • What if we want to get the sum and the value column? (group and detail) • If we are in SQL 2005/2008/2008R2…am i correct with this approach? select id_table, value, sum(value) as [sum(value)] from table1 group by id_table Msg 8120, Level 16, State 1, Line 1 Column 'table1.value' is invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause. id_table value 1 1 2 1 2 2 3 1 3 2 3 3 SUM(value) 1 3 6 id_table value sum(value) 1 1 1 2 1 3 2 2 3 3 1 6 3 2 6 3 3 6 Select sum(value) as [sum(value)] from table1 group by id_table © 2012 SolidQ
  • 15. Why do we need windows functions? •Now we know that the OVER clause exists… •This must be our solution select id_table, value, sum(value) over(partition by id_table) from table1 id_table value sum(value) 1 1 1 2 1 3 2 2 3 3 1 6 3 2 6 3 3 6 © 2012 SolidQ
  • 16. New syntax to solve old problems • Partitioning • Ordering • Slicing/framing © 2012 SolidQ
  • 17. Key concepts: All together Partition UNBOUNDED FOLLOWING UNBOUNDED PRECEDING CURRENT ROW © 2012 SolidQ
  • 19. Key concepts: Partition •Partition is like a group of rows with similar “characteristics” inside a set © 2012 SolidQ
  • 20. Key concepts: Partition •Partition is like a group of rows with similar “characteristics” inside a set © 2012 SolidQ
  • 21. Key concepts: Slicing/Framing • RANGE/ROWS • ROWS | RANGE BETWEEN <B1> AND <B2> • ROWS | RANGE <B1> © 2012 SolidQ
  • 22. Key concepts: Slicing/Framing • B1 and B2 can be • UNBOUNDED PRECEDING • UNBOUNDED FOLLOWING • CURRENT ROW • For “ROWS” clause only o <scalar expression> PRECEDING o <sclara expression> FOLLOWING • Note • B1 <= B2 or NULL will be returned o Except in COUNT() that 0 will be returned © 2012 SolidQ
  • 23. Key concepts: All together Partition UNBOUNDED FOLLOWING UNBOUNDED PRECEDING CURRENT ROW © 2012 SolidQ
  • 24. New windowing functions • New analytic functions in SQL 2012 • offset • LAG() • LEAD() • FIRST_VALUE() • LAST_VALUE() • Distribution • PERCENT_RANK() • CUME_DIST() • PERCENTILE_CONT() • PERCENTILE_DIST() © 2012 SolidQ
  • 25. DEMO 1: NEW FUNCTIONS AND SYNTAX Basics on framing, RANGE vs ROWS, new window functions © 2012 SolidQ
  • 26. Objectives of this session •Introduction •The past, the present and the future •Window Functions • Why do we need window functions? • Syntax • Performance • Why almost complete? •Q&A 26 |© 2012 SolidQ
  • 27. Objectives of this session •Introduction •The past, the present and the future •Window Functions • Why do we need window functions? • Syntax • Performance • Why almost complete? •Q&A 27 |© 2012 SolidQ
  • 28. Performance: IN-MEMORY vs ON DISK • Directly affected by Window Spool Operator • Used to store the framing data • In-memory vs disk-based worktable • In-memory worktable • Fastest • Prerequisites: Framing defined using ROWS and working with <10k rows • Disk-based worktable • Default • Used when the window was defined using RANGE • Used when the windows was defined using ROWS and the frame has more than 10k rows © 2012 SolidQ
  • 29. Performance: Indexing •Index order by the window partitioning elements and then by the order elements •Include the rest of the columns •Optimized execution operators: 1. Scan 2. Segment 3. Window spool 4. Aggregate © 2012 SolidQ © 2012 SolidQ
  • 30. DEMO 2: PERFORMANCE Running Totals, in memory vs on disk, … © 2012 SolidQ
  • 31. Why almost complete? • RANGE only supports • UNBOUNDED PRECEDING • UNBOUNDED FOLLOWING • CURRENT ROW • Ranking functions does not support framing: • ROW_NUMBER, RANK, NTILE,DENSE_RANK, PERCENTILE_DIST, PERCENTILE_CONT • Not implemented • WINDOW aliases • Clauses: NULLs FIRST and NULLs LAST © 2012 SolidQ
  • 32. Objectives of this session •Introduction •The past, the present and the future •Window Functions • Why do we need window functions? • Syntax • Performance • Why almost complete? •Q&A 32 |
  • 33. THANK YOU! Enrique Catalá Bañuls Mentor, SolidQ MAP 2012 – Microsoft Technical Ranger – Microsoft Certified Trainer ecatala@solidq.com Twitter: @enriquecatala