Results for “SQL Server”
Small, practical examples. Search by task or narrow things down below.
Enforce a relationship between two columns
Postgres: A row-level CHECK can require a start value to be no greater than an end value.
Postgres✓ Tested
Enforce uniqueness with a dedicated index
Postgres: A unique index rejects a duplicate combination independently of query plans.
Postgres✓ Tested
Expand a JSON array into rows
Iterate array elements using a table-valued function.
json_each✓ Tested
Expand an array into rows
Use WITH ORDINALITY to retain original element order.
unnest✓ Tested
Expose a reusable filtered view
Postgres: A view stores a query definition rather than a snapshot of its rows.
Postgres✓ Tested
Extract a JSON field
Read a scalar value from JSON text.
json_extract✓ Tested
Extract part of a date
Read a calendar component with EXTRACT.
EXTRACT✓ Tested
Extract part of a string
Use one-based positions with substr.
substr✓ Tested
Filter aggregate groups
Keep only categories with multiple products.
HAVING✓ Tested
Filter by a numeric comparison
Postgres: Keep rows whose quantity exceeds a chosen threshold.
Postgres✓ Tested
Filter groups after aggregation
Postgres: Use HAVING to test a group’s calculated total.
Postgres✓ Tested
Filter rows before grouping
Postgres: WHERE limits the rows contributing to the aggregate; it differs from filtering completed groups with HAVING.
Postgres✓ Tested