FIND YOUR NEXT FEW LINES

Results for “Text validation & formatting”

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

939 snippets foundClear filters
PostgresWindows & text

Calculate a running total

Accumulate values in row order.

window✓ Tested
PostgresWindows & text

Compare a row with the previous row

Read a preceding value with LAG.

LAG✓ Tested
SQL ServerDates & text

Count day boundaries between dates

Compare date values with DATEDIFF.

DATEDIFF✓ Tested
SQLiteJSON data

Extract a JSON field

Read a scalar value from JSON text.

json_extract✓ Tested
SQL ServerDates & text

Find the final day of a month

Use EOMONTH without manually calculating month length.

EOMONTH✓ Tested
SQLiteDates & time

Format a timestamp

Extract a year and month from ISO timestamp text.

strftime✓ Tested
SQLiteQueries & text

Generate numbers with a recursive CTE

Build a bounded sequence using SQL recursion.

recursive CTE✓ Tested
HTMLInput constraints

Limit a numeric input to an inclusive range

HTML: Number inputs expose range validation separately from the entered text.

HTML✓ Tested
SQLiteQueries & text

Number a sorted result

Assign a row number without changing stored data.

row_number✓ Tested
PostgresWindows & text

Number rows within each group

Assign ordered row numbers with a window function.

row_number✓ Tested
SQLConstraints & defaults

Require a value with NOT NULL

SQL: Declare required fields at the database boundary, not only in application validation.

SQL✓ Tested
SQL ServerConstraints & defaults

Require a value with NOT NULL

SQL Server: Declare required fields at the database boundary, not only in application validation.

SQL Server✓ Tested