D
D
des1roer2015-06-08 09:04:11
PostgreSQL
des1roer, 2015-06-08 09:04:11

Postgres return the given number if there is no result?

I can't figure out where the error is

SELECT 
 NULLIF ((max(VALUE::int) + 1), 1)
FROM 
  table

if null it should return 1?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
krypt3r, 2015-06-08
@des1roer

Isn't COALESCE() better for you?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question