Tags / case
Using max() Window Function with Case When for Conditional Grouping and Aggregation in SQL
Using Conditional Logic in SQL to Return a Single Row with Specific Conditions
Effective SQL Data Manipulation: Alternatives to Traditional Case Statements Using Row Number
Writing Efficient IF Statements in SQL: A Practical Guide
Optimizing SQL Queries for Conditional Summation