Home > Enterprise >  Equal operation in PostgreSQL
Equal operation in PostgreSQL

Time:08-19

Hey I am trying to compare two values against another value, is it possible to just write A=B=3 instead of A=3 AND B=3?

CodePudding user response:

No, that's not possible.

If you want to avoid writing the constant multiple times, you can use:

3 = all(array[a,b])

alternatively using standard SQL

3 = all( values(a),(b) )

Or use an AND condition:

a = b and a = 3
  • Related