Label for checking logical false value

In java, the following works:

boolean varBoo = true;

if(varBoo) means: if(varBoo = true) and

if(!varBoo) means: if(varBoo = false)

Im working on the postgreSQL statement right now, which looks like this:

 CASE WHEN varInt < XX AND varBoo THEN 1.0 -- Short for varBoo = TRUE WHEN varInt < XX AND varBoo = FALSE THEN 0.5 END 

Is there a way to write varBoo = FALSE shorter in PostgreSQL?

the java equivalent would be !varBoo .

+6
source share
1 answer

You can try with not :

 case when varInt < XX and varBoo then 1.0 when varInt < XX and not(varBoo) then 0.5 end 
+3
source

Source: https://habr.com/ru/post/989452/


All Articles