Results for “if”
Small, practical examples. Search by task or narrow things down below.
Find rows in the first result but not the second
Postgres: EXCEPT calculates a distinct result-set difference.
Postgres✓ Tested
Find rows in the first result but not the second
SQLite: EXCEPT calculates a distinct result-set difference.
SQLite✓ Tested
Find rows shared by two query results
SQL: INTERSECT compares complete selected rows and removes duplicates.
SQL✓ Tested
Find rows shared by two query results
SQL Server: INTERSECT compares complete selected rows and removes duplicates.
SQL Server✓ Tested
Find rows shared by two query results
Postgres: INTERSECT compares complete selected rows and removes duplicates.
Postgres✓ Tested
Find rows shared by two query results
SQLite: INTERSECT compares complete selected rows and removes duplicates.
SQLite✓ Tested
Find rows with a related record
Use EXISTS without duplicating the outer rows.
EXISTS✓ Tested
Find the final day of a month
Use EOMONTH without manually calculating month length.
EOMONTH✓ Tested
Find the final path separator
C: strrchr locates the last matching character without modifying the input.
C✓ Tested
Find the first day of a month
Round a date to its calendar month boundary.
date✓ Tested
Find the first occurrence of a character
C: strchr returns a pointer into the input or NULL if the character is absent.
C✓ Tested
Find the next chosen weekday
Java: TemporalAdjusters.next excludes the starting day even if it already has that weekday.
Java✓ Tested