By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
create table mexico
(
population int
);
insert into mexico (population) values (500);
select * from mexico;
population |
---|
500 |
select case population
when 0 then 1
else population
end
from mexico;
(No column name) |
---|
500 |
truncate table mexico;
insert into mexico (population) values (0);
select * from mexico;
population |
---|
0 |
select case population
when 0 then 1
else population
end
from mexico;
(No column name) |
---|
1 |