SQLize Online / PHPize Online  /  SQLtest Online

A A A
Share      Blog   Popular
Copy Format Clear
create table tbl ( line int, color varchar(12), status varchar(24) ); insert into tbl values (1, 'red', 'not yet started'), (2, 'red', 'approved'), (3, 'green', 'approved'), (4, 'green', 'approved'), (5, 'green', 'approved'); select count(1) from tbl group by color having count(*) = count(case when status = 'approved' then status end);
Stuck with a problem? Got Error? Ask ChatGPT!
Copy Clear