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 (13)
  • 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
  • SSIS vs. SQL: Source Code Management — Why SP Diffs Are Readable and `.dtsx` Diffs Are Not
    Published Aug 30, 2018 · Updated Sep 2, 2026
  • SSIS vs. SQL — When to Use SSIS, When Pure T-SQL, When to Combine?
    Published Aug 14, 2018 · Updated Sep 2, 2026
  • Data quality in SQL Server // TRY_CONVERT for bit done safely — converting yes/no values
    Published Mar 7, 2024 · Updated Sep 1, 2026
  • Data quality in SQL Server // TRY_CONVERT for float and real done safely
    Published Mar 6, 2024 · Updated Sep 1, 2026
  • Data quality in SQL Server // TRY_CONVERT for money and smallmoney done safely
    Published Mar 3, 2024 · Updated Sep 1, 2026

Tags

Claude Code (12) Data Migration (7) Data Quality (18) Data Type (6) Design Pattern (5) Developer Workflow (9) ETL Process (7) PL/pgSQL (5) Postgres (5) PostgreSQL (16) Readability (7) SQL Server (6) SSIS (5) 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 (2) AI-Assisted Development (1) AI Agents (1) Automation (1) Backfill (1) Change Tracking (1) CI/CD (2) Claude (1) Claude Code (12) Code Quality (2) Comparison (1) Context Management (1) Conventions (3) Database Deployment (4) 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 (9) 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 (16) 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)