I have a table like this :
CREATE TABLE foo_table (
a ... ,
b ... ,
c ... ,
);
ALTER TABLE ONLY foo_table
ADD CONSTRAINT unique_constraint UNIQUE (a,b);
Now ,I'm looking to write a postgresql SELECT
in single query with someWHERE
conditions to do the following :
if (a and b and c) :
return 1
elif not ( a and b) :
return 2
elif not ( a and b and c) :
return 3
What is the best way? my PostgreSQL version is 9.6.6