add batch remove batch split batch comment selection show hidden batches hide batch highlight batch
db<>fiddle
donate feedback about
By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
create table my_table (
field1 varchar(5),
field2 int
);

insert into my_table values
('AAA',1),
('AAA',2),
('AAA',0),
('BBB',1),
('BBB',2),
('CCC',0),
('CCC',2),
('DDD',3);
Records: 8  Duplicates: 0  Warnings: 0
select * from my_table;
field1 field2
AAA 1
AAA 2
AAA 0
BBB 1
BBB 2
CCC 0
CCC 2
DDD 3
select m.*
from my_table m
where not exists (select 1 from my_table mt where m.field1 = mt.field1 and field2 = 0);
field1 field2
BBB 1
BBB 2
DDD 3
select field1
from my_table
group by field1
having min(field2) <> 0;
field1
BBB
DDD