This month's discount Comprehensive Database Performance Health Check · Testimonials
SQLAuthority with Pinal Dave
Home
  • Consulting
    • Health Check
  • Free Videos
  • All Articles
    • AI
    • SQL Performance
    • SQL Tips and Tricks
    • Interview Questions and Answers
    • SQL Puzzle
    • SQL Video
    • SQLAuthority News
    • Personal
  • Books
  • Consulting
SQL SERVER - Ranking Functions - RANK( ), DENSE_RANK( ), and ROW_NUMBER( ) - Day 12 of 35

SQL SERVER – Ranking Functions – RANK( ), DENSE_RANK( ), and ROW_NUMBER( ) – Day 12 of 35

August 12, 2011
Pinal Dave
SQL Tips and Tricks
Joes 2 Pros, Ranking Functions, SQL Scripts, SQL Server

RANK( ), DENSE_RANK( ), and ROW_NUMBER( ) return the same results until your data has a tie. Day 12 shows how each ranking function handles tied values.

Read More
Gouache painting: two wooden posts stand at opposite ends of a meadow

geometry STLength: A Path Is Longer Than Its Chord

August 11, 2011
Pinal Dave
SQL Tips and Tricks
SQL Datatype, SQL Function, SQL Scripts, SQL Server

geometry STLength measures the segments of a line. The example contrasts that path length with the shortest distance between its endpoints, including a closed line.

Read More
SQL query results window.

SQL SERVER – Tips from the SQL Joes 2 Pros Development Series – Advanced Aggregates with the Over Clause – Day 11 of 35

August 11, 2011
Pinal Dave
SQL Tips and Tricks
Joes 2 Pros, SQL Scripts

Advanced aggregates with the OVER clause from Joes 2 Pros: partition your data so each number is compared against its own category, not the whole set.

Read More
A detached ceramic lid beside an empty pale cup and a blue cup holding a stone on sage cloth.

FOR XML XSINIL: Emit Missing Fields as Explicit Nil Elements

August 10, 2011
Pinal Dave
SQL Tips and Tricks
SQL Function, SQL Scripts, SQL Server, SQL XML

FOR XML XSINIL can represent SQL NULL with an explicit element carrying the xsi:nil attribute. I compare that output with ordinary element omission. An empty string stays a separate input in both versions.

Read More
SQL SERVER - Tips from the SQL Joes 2 Pros Development Series - Aggregates with the Over Clause - Day 10 of 35

SQL SERVER – Tips from the SQL Joes 2 Pros Development Series – Aggregates with the Over Clause – Day 10 of 35

August 10, 2011
Pinal Dave
SQL Tips and Tricks
Joes 2 Pros, SQL Scripts

A Joes 2 Pros tip on aggregates with the OVER clause: show each grant next to the total of all grants and work out its share, just like market share.

Read More
SQL SERVER - Use INSERT INTO ... SELECT instead of Cursor

SQL SERVER – Use INSERT INTO … SELECT instead of Cursor

August 10, 2011
Pinal Dave
SQL Tips and Tricks
Best Practices, SQL Scripts

The story of my old cursor code that got laughed at in code review, and why a single INSERT INTO SELECT instead of cursor loops does the same job better.

Read More
One brass key blank fits a precise profile jig while a similar blank with a different ridge rests outside

LIKE Character Ranges: [a-f], [^0-9] and Collation Traps

August 9, 2011
Pinal Dave
SQL Tips and Tricks
SQL Collation, SQL NULL, SQL String, Unicode

A bracket range sounds simple until the collation decides what sits between a and f. Test it once so a bad code never reaches your table.

Read More
Previous 1 … 578 579 580 581 582 583 584 … 841 Next
  • Books
  • Testimonials
  • Privacy Policy

© 2006 – 2026 All rights reserved. pinal @ SQLAuthority.com