FIND YOUR NEXT FEW LINES

Results for “SQL”

Small, practical examples. Search by task or narrow things down below.

500 snippets foundClear filters
SQLiteBulk changes & set operations

Update rows selected by a related table

SQLite: Use EXISTS to limit updates based on an independent eligibility table.

SQLite✓ Tested
SQLBulk changes & set operations

Update several classifications in one statement

SQL: A CASE expression computes the new value for each row covered by the update predicate.

SQL✓ Tested
SQL ServerBulk changes & set operations

Update several classifications in one statement

SQL Server: A CASE expression computes the new value for each row covered by the update predicate.

SQL Server✓ Tested
SQLiteBulk changes & set operations

Update several classifications in one statement

SQLite: A CASE expression computes the new value for each row covered by the update predicate.

SQLite✓ Tested
PostgresGetting Started

Accept either of two conditions

Postgres: Use OR to keep matching names or out-of-stock rows.

Postgres✓ Tested
PostgresDates & series

Add an interval to a date

Perform calendar arithmetic with an interval literal.

INTERVAL✓ Tested
PostgresSchema design & transactions

Add an optional field to an existing table

Postgres: A nullable column permits existing rows to remain valid while data is filled later.

Postgres✓ Tested
SQL ServerDates & text

Add days to a date

Use DATEADD for date arithmetic.

DATEADD✓ Tested
SQLiteDates & time

Add days to a date

Use a date modifier for calendar arithmetic.

date✓ Tested
PostgresGetting Started

Add values across several rows

Postgres: Use SUM to calculate a total quantity.

Postgres✓ Tested
PostgresConstraints & defaults

Apply a default when an insert omits a column

Postgres: A default supplies an omitted value; an explicit NULL still follows the column’s nullability rules.

Postgres✓ Tested
SQL ServerSelect & page

Assign a rank within each group

Number rows with a partitioned window.

ROW_NUMBER✓ Tested