今天看到一段sql的约束
create table emploee (
id bigserial NOT NULL PRIMARY KEY,
name varchar(32) NOT NULL,
age int NOT NULL,
sex int NOT NULL,
salary int NOT NULL
);
alter table emploee add constraint check_salary check
(
case when sex = 2 then
case when salary <= 200000 then 1 else 0 end
else 1 end = 1
);
倒数第二行 else 1 end = 1 没有理解为什么要写上 'end=1'
查询语句没有看到end=1这种操作,'else 1 end'不能理解为返回为真嘛?