Set-Based

Building Your T-SQL Tool Kit: Window Function Fundamentals

Sergio Govoni

Sul canale SQLPASS TV è stata pubblicata la sessione Building Your T-SQL Tool Kit: Window Function Fundamentals tenuta da Christina E. Leo (@christinaleo) durante lo scorso PASS Summit 2013.

Abstract

Have you pulled a script to identify duplicates from a blog post but couldn’t quite get it to work because you weren’t sure what that ROW_NUMBER() function was doing? Maybe you heard talk about creating running totals without using subqueries, but you got frustrated when the groups weren’t totaling correctly. Or maybe, you’ve never even heard of window functions. All are good reasons to attend this all-demo session, which demystifies this versatile T-SQL tool. First, we’ll break apart the OVER clause, the key to understanding how window functions work. Then we’ll expand on each group of functions that can use the OVER clause: ranking, aggregate, and analytic functions. Finally, we’ll look at real scenarios where this tool works and talk about performance considerations. When you leave, you’ll have the fundamentals you need to fully develop your mastery of window functions.

Calcolo della cifra di controllo di un codice EAN/UCC (versione 2.0)

Sergio Govoni

Qualche tempo fa, in questo articolo, abbiamo analizzato l’algoritmo di calcolo della cifra di controllo di un codice UCC/EAN, chi si occupa di logistica conoscerà bene l’argomento.

Lo standard di codifica UCC/EAN richiede che ogni codice generato termini con una cifra compresa tra zero (0) e nove (9), chiamata cifra di controllo (dall’inglese check digit). Questa cifra è calcolata in funzione delle altre cifre che compongono il codice e ha lo scopo di garantire che il codice, stampato in formato barcode, sia interpretato correttamente dal lettore ottico.