i have table1 that have a "status" field of type bit
i wanna get true if all rows have status=1
i want something like this:
select And(status) from table1
If I get your question correctly, this can help you. You want true if all rows have status equal to 1.
IF EXISTS (SELECT 1 FROM Table1 WHERE status <> 1) THEN SELECT false ELSE SELECT true END IF