25.10.2013 Views

New SQL Features in Firebird

New SQL Features in Firebird

New SQL Features in Firebird

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Common <strong>SQL</strong> : WINDOW FUNCTIONS<br />

Example<br />

36<br />

SELECT A, B, C,<br />

SUM(C) OVER(),<br />

SUM(C) OVER(ORDER BY A, B),<br />

SUM(C) OVER(PARTITION BY A),<br />

SUM(C) OVER(PARTITION BY A ORDER BY B)<br />

A B C SUM SUM1 SUM2 SUM3<br />

1 1 30 141 30 60 30<br />

1 2 20 141 50 60 50<br />

1 3 10 141 60 60 60<br />

2 1 25 141 85 40 25<br />

2 2 15 141 100 40 40<br />

3 1 41 141 141 41 41<br />

Luxembourg 2011 Whats new <strong>in</strong> <strong>Firebird</strong> <strong>SQL</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!