Hi! Could we please enable some services and cookies to improve your experience and our website?

SQLize | PHPize | SQLtest

Online Sandbox for SQL and PHP: Write, Run, Test, and Share SQL Queries and PHP Code

A A A
Login    Share code      Blog   FAQ
Copy Format Clear
create table test (id int, c1 int, c2 int, c3 int, c4 int, c5 int, c6 int, c7 int); insert into test values (1, 1, 1, 1, 1, 1, 1, 1), (2, 1, 1, 1, 1, 1, 1, 0), (3, 1, 1, 1, 1, 1, 1, 2), (4, 1, 0, 1, 1, 1, 0, 1); SELECT id, (c1=1) + (c2=0) + (c3=1) + (c4=1) + (c5=1) + (c6=1) + (c7=1) FROM test WHERE ((c1=1) + (c2=0) + (c3=1) + (c4=1) + (c5=1) + (c6=1) + (c7=1)) = 6 ;

Stuck with a problem? Got Error? Ask AI support!

Copy Clear