Applying the MIN aggregate function to a BIT field

前端 未结 7 537
甜味超标
甜味超标 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条回答
  • 2020-12-05 02:21

    One option is MIN(SomeBitField+0). It reads well, with less noise (which I would qualify as elegance).

    That said, it's more hack-ish than the CASE option. And I don't know anything about speed/efficiency.

    0 讨论(0)
提交回复
热议问题