how to get & ldquo; ET & rdquo; of all the values ​​of a Boolean column in a single sql

advertisements

how to get "AND" of all the values of a boolean column in a single sql query.

for above the o/p should be false,

if all were true then o/p: true,

if all/atlease one value false , then o/p: false.


Try this

IF EXISTS (SELECT ActiveStatus From TableName where ActiveStatus = 0)
  SELECT 'False'
ELSE
  SELECT 'True'
AS OutputColumn