anyone know offhand if there is a TSQL function similar to COALESCE but instead of it returning the first non-null value it returns the largest value in the series?
r
Rodney
10/09/2023, 3:22 PM
What version of SQL Server? 2016+
Copy code
SELECT MAX(value) AS maxValue
FROM STRING_SPLIT('10,13,15,8,2', ',')
w
websolete
10/09/2023, 3:23 PM
2019 but a db in 2008 r2 compat. will give it a try, thanks
r
Rodney
10/09/2023, 3:24 PM
Yeah, it will need to be in 2016+ compat mode.
✔️ 1
p
Patrick
10/09/2023, 3:25 PM
RIP for having to deal with 2008 compat
w
websolete
10/09/2023, 3:26 PM
it's like having a brand new car that runs on leaded gas