Question: What is Faster, SUM or COUNT? Answer: Both are the same. I was asked this question during my Comprehensive Database Performance Health Check.
Every Second Item Free: Pricing Promotions With ROW_NUMBER
Price every second item as free with ROW_NUMBER, expand quantities into units, and calculate basket discounts without double counting.
Period-to-Date Totals: Today, Week, Month and Year in One Scan
Calculate period-to-date totals with shared scan boundaries, Monday-based weeks, and older date arithmetic for SQL Server reports.
Pulling Values Out of Text With REGEXP_SUBSTR and REGEXP_INSTR
Extract codes with REGEXP_SUBSTR in SQL Server 2025, locate matches, select occurrences and capture groups, and validate text boundaries.
GET_BIT: Read a Flag at a Zero-Based Position
GET_BIT reads a zero-based bit position. Compare tinyint offsets, retain the source value, and check type width before selecting a position.
PostgreSQL – Storing Unicode Characters is Easy
PostgreSQL varchar can store Unicode with suitable database and client encodings. My example stores ЯНВАРЬ, the Russian word for January.
Scheduling Recurring Events: Every Second Tuesday in T-SQL
Generate recurring events with stable weekday arithmetic, monthly ranking, and anchored fourteen-day rules instead of endless date rows.







