Skip to content
SQL & Beyond

SQL & Beyond

  • home
  • featured
    • GitHub: di2-starter-kit
    • Alex Sprogis: AI Coding Starter Kit
    • Pencil’n more
    • Bestes Sohn Seite
  • imprint
  • privacy
  • contact
  • English
    • Deutsch
    • English

Duplicates

Finding Duplicates with SQL — From COUNT(*) > 1 to Composite Keys

22. August 20261. July 2026 by marcus

GROUP BY … HAVING count(*) > 1 may be the most-typed SQL snippet in the world — and yet it trips up in two places almost nobody has on their radar: composite keys and NULL. When it comes to missing values in a unique column, SQL Server and Postgres disagree — one allows exactly one NULL, the other any … Read more

Tags Data Quality, Data Quality Rules, Duplicates, Dynamic SQL

Article Series

  • Data Quality in an ETL Process
  • Data Quality Checks with SQL
  • Data Migration: SQL Server → PostgreSQL
  • AI-Assisted SQL Development
  • Structuring & Formatting SQL
  • SSIS vs. T-SQL

Categories

  • AI & Development (23)
  • Data Quality (8)
  • Database Deployment (5)
  • SQL & Databases (36)

Latest Posts

  • Data Quality: Dimensions and Error Classes — the Theory Behind the SQL Checks
    Published Jul 2, 2026 · Updated Aug 22, 2026
  • Why sqlfluff Can’t Lint Our SQL Conventions — and a 240-Line Script Can
    Published Aug 23, 2026 · Updated Sep 21, 2026
  • The Green Test That Proves Nothing — Why a Passing Test Suite Confirmed the Bug It Was Supposed to Catch
    Published Sep 16, 2026 · Updated Sep 21, 2026
  • How to Write Manual Test Cases — Structure, Template and Four Rules from a Project with a Coding Agent
    Published Sep 18, 2026 · Updated Sep 20, 2026
  • Unit Test Passes, Integration Fails — Three Questions You Can Ask Without Reading the Code
    Published Sep 20, 2026
  • The First Run Tests the Test Case — What a Test Case Is Worth When Nobody Has Ever Executed It
    Published Sep 17, 2026 · Updated Sep 18, 2026

Tags

AI-Assisted Development (11) AI Agents (6) Claude Code (21) Code Quality (6) Data Migration (7) Data Quality (18) Data Type (6) Developer Workflow (19) ETL Process (7) Formatting (5) PostgreSQL (17) Readability (7) SQL Server (6) T-SQL (11) TRY_CONVERT (6) Type Conversion (8)

Show all tags

© 2018–2026 Marcus Belz · Imprint · Privacy · Contact · How This Blog Is Made

All tags

AI (1) AI-Assisted Development (11) AI-Assisted Development (1) AI Agents (6) Automation (1) Backfill (1) Change Tracking (1) CI/CD (2) Claude (1) Claude Code (21) Code Quality (6) Comparison (1) Context Management (1) Conventions (3) Database Deployment (5) Data Integration (1) Data Migration (7) Data Quality (18) Data Quality Dimensions (1) Data Quality Rules (4) Data Transfer (1) Data Type (6) Data Type Mapping (1) Design Pattern (5) Developer Workflow (19) Duplicates (1) Dynamic SQL (4) ELT (1) Error Classification (1) ESLint (1) ETL (1) ETL Process (7) Expand/Contract (1) Formatting (5) GitHub Actions (2) Logging (1) Maintainability (3) Metadata (1) Naming Convention (4) PL/pgSQL (5) Postgres (5) PostgreSQL (17) Project Setup (1) Project Template (1) Prompt Engineering (1) Readability (7) Referential Integrity (1) Schema Evolution (3) Schema Migration (3) Source Control (1) SQL Server (6) SSIS (5) SSIS vs. SQL (4) Stored Procedure (1) T-SQL (11) Table Design (1) Theory (1) TRY_CONVERT (6) Type Conversion (8) Validation (1) Verification (1)