Applying the MIN aggregate function to a BIT field

前端 未结 7 535
甜味超标
甜味超标 2020-12-05 01:36

I want to write the following query:

SELECT   ..., MIN(SomeBitField), ...
FROM     ...
WHERE    ...
GROUP BY ...

The problem is, SQL Ser

7条回答
  •  -上瘾入骨i
    2020-12-05 02:20

    AVG(CAST(boolean_column AS FLOAT)) OVER(...) AS BOOLEAN_AGGREGATE

    Give a fuzzy boolean :

    • 1 indicate that's all True;

    • 0 indicate that's all false;

    • a value between ]0..1[ indicate partial matching and can be some percentage of truth.

提交回复
热议问题