select open change scope Open full search

PG.CENTER connects PostgreSQL documentation, reference, and ecosystem knowledge. Maintained by Pigsty.

FUNCTIONS / MATHEMATICAL FUNCTIONS AND OPERATORS

Least common multiple (the smallest strictly positive number that is an integral multiple of both inputs); returns 0 if either input is zero; available for integer, bigint, and numeric

Signatures & examples

lcm ( numeric_type, numeric_type ) → numeric_type
Least common multiple (the smallest strictly positive number that is an integral multiple of both inputs); returns 0 if either input is zero; available for integer, bigint, and numeric
lcm(1071, 462) → 23562
Version history 1
  1. PG 12 → 13added

Definition snapshot: 2026-09-14T13:14:25.684213+00:00@99e6866c · English manual source