SQLCASEtutorial

What is CASE WHEN in SQL? Conditional logic for beginners

CASE WHEN is "if/else inside SQL". Plain words: how to put conditions right into SELECT, the difference between searched CASE and simple CASE, bucketing numbers into categories, pivoting with one formula, and conditional aggregates. With tables and common pitfalls.

1 Min. LesezeitSQL · CASE · tutorial

CASE WHEN is "if/else inside a SQL query". The way to put a condition right in SELECT, UPDATE, or WHERE and get one of several values depending on the row.

This article is currently in Russian. The full English translation is on the way.

Übe an echten Aufgaben

Löse Aufgaben im SQL-Trainer mit sofortiger Bewertung und Hinweisen.

Trainer öffnen