Get MAX value of a BIT column
Solution 1:
you can cast it to an INT
, and even cast it back to a BIT
if you need to
SELECT
sur.*
,CAST(MAX(CAST(bo.BOOL as INT)) AS BIT)
FROM SURNAME sur
INNER JOIN BOOL bo
ON bo.IDPERS = sur.IDPERS
Solution 2:
Try:
max(cast(bo.BOOL as int))