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
Two bowls hold equal groups of qualifying red beads while green beads remain outside

What is Faster, SUM or COUNT? – Interview Question of the Week #231

June 30, 2019
Pinal Dave
SQL Interview Questions and Answers
SQL Function, SQL Performance, SQL Scripts, SQL Server

Question: What is Faster, SUM or COUNT? Answer: Both are the same. I was asked this question during my Comprehensive Database Performance Health Check.

Read More
Pumpkins in pairs on a farm stand, the smaller of each pair tied with a red ribbon, one unpaired pumpkin at the end.

Every Second Item Free: Pricing Promotions With ROW_NUMBER

May 27, 2019
Pinal Dave
SQL Tips and Tricks
Ranking Functions, SQL Function, SQL Scripts, SQL Server

Price every second item as free with ROW_NUMBER, expand quantities into units, and calculate basket discounts without double counting.

Read More
An archery target with four nested rings in a field, one arrow in the red center and others in outer rings

Period-to-Date Totals: Today, Week, Month and Year in One Scan

April 27, 2019
Pinal Dave
SQL Tips and Tricks
SQL DateTime, SQL Function, SQL Reports, SQL Server

Calculate period-to-date totals with shared scan boundaries, Monday-based weeks, and older date arithmetic for SQL Server reports.

Read More
A red horseshoe magnet lifting screws and nails out of a pile of sawdust on a workbench

Pulling Values Out of Text With REGEXP_SUBSTR and REGEXP_INSTR

April 22, 2019
Pinal Dave
SQL Tips and Tricks
SQL Function, SQL Scripts, SQL Server, SQL String

Extract codes with REGEXP_SUBSTR in SQL Server 2025, locate matches, select occurrences and capture groups, and validate text boundaries.

Read More
A walnut rail with round recesses and one cream peg beside a brass magnifying glass tied with red cord.

GET_BIT: Read a Flag at a Zero-Based Position

March 8, 2019
Pinal Dave
SQL Tips and Tricks
SQL Datatype, SQL Function, SQL Scripts

GET_BIT reads a zero-based bit position. Compare tinyint offsets, retain the source value, and check type width before selecting a position.

Read More
A woven motif remains intact on a source cloth and a separately framed copy.

PostgreSQL – Storing Unicode Characters is Easy

February 16, 2019
Pinal Dave
SQL Tips and Tricks
PostgreSQL, SQL Function, SQL String, Unicode

PostgreSQL varchar can store Unicode with suitable database and client encodings. My example stores ЯНВАРЬ, the Russian word for January.

Read More
Two wooden metronomes side by side on a shelf, their pendulums swinging at different tempos

Scheduling Recurring Events: Every Second Tuesday in T-SQL

February 12, 2019
Pinal Dave
SQL Tips and Tricks
SQL DateTime, SQL Function, SQL Scripts, SQL Server

Generate recurring events with stable weekday arithmetic, monthly ranking, and anchored fourteen-day rules instead of endless date rows.

Read More
Previous 1 … 8 9 10 11 12 13 14 … 92 Next
  • Books
  • Testimonials
  • Privacy Policy

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