División por zero postgres

Ejemplos de código

0
0

postgres: ERROR: división por cero

SELECT 1.0 / NULLIF(column_that_may_be_zero, 0)
0
0

división por zero postgres

-- avoid division error in Postgres
value/NULLIF(col, 0)  -- if col == 0, NULL will be returned
value/COALESCE(NULLIF(col, 0), 1)  -- if col == 0, value will be returned 

Páginas relacionadas

Páginas de ejemplo relacionadas

En otros idiomas

Esta página está en otros idiomas

Русский
..................................................................................................................
English
..................................................................................................................
Italiano
..................................................................................................................
Polski
..................................................................................................................
Română
..................................................................................................................
한국어
..................................................................................................................
हिन्दी
..................................................................................................................
Français
..................................................................................................................
Türk
..................................................................................................................
Česk
..................................................................................................................
Português
..................................................................................................................
ไทย
..................................................................................................................
中文
..................................................................................................................
Slovenský
..................................................................................................................
Балгарскі
..................................................................................................................
Íslensk
..................................................................................................................