FIND YOUR NEXT FEW LINES

Results for “lcm”

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

128 snippets foundClear filters
SQL ServerBulk changes & set operations

Copy selected rows into another table

SQL Server: INSERT SELECT performs a set-based copy with an explicit destination column list.

SQL Server✓ Tested
SQL ServerDates & text

Count day boundaries between dates

Compare date values with DATEDIFF.

DATEDIFF✓ Tested
SQL ServerReporting & grouped calculations

Count distinct values within a result

SQL Server: COUNT DISTINCT counts distinct non-null values.

SQL Server✓ Tested
SQL ServerReporting & grouped calculations

Count rows satisfying separate conditions

SQL Server: SUM over CASE expressions calculates several conditional counts in one scan.

SQL Server✓ Tested
SQL ServerGetting Started

Count the rows in a table

SQL Server: COUNT(*) includes every row, including rows with NULL columns.

SQL Server✓ Tested
SQL ServerGetting Started

Create a table and insert its first row

SQL Server: Define column types and a primary key, then insert one row using an explicit column list.

SQL Server✓ Tested
SQL ServerSchema design & transactions

Create an index for an equality filter

SQL Server: A nonunique index can support lookups on a frequently filtered column.

SQL Server✓ Tested
SQL ServerSchema design & transactions

Create an index matching filter and ordering columns

SQL Server: Place the equality-filter column before the ordering column in this composite index.

SQL Server✓ Tested
SQL ServerGetting Started

Delete one row from a practice table

SQL Server: Restrict DELETE with a primary-key condition and verify the remaining row count.

SQL Server✓ Tested
SQL ServerBulk changes & set operations

Delete rows selected by a related table

SQL Server: A correlated EXISTS limits the delete to explicitly listed records.

SQL Server✓ Tested
SQL ServerGetting Started

Display a fallback for missing data

SQL Server: Return a supplied label when a column contains NULL.

SQL Server✓ Tested
SQL ServerReporting & grouped calculations

Distinguish row count from non-null value count

SQL Server: COUNT(*) includes every row while COUNT(column) skips NULL values.

SQL Server✓ Tested