I am trying to run a simple report where one of the columns is a float type, but I want to change the result to show a string (I think that is the best way). If the value of the float column is 101 or 201, I want the result to show as '101, 201' and other values to show as they are in the table.
This is what I've been messing with, but the results are incorrect:
SELECT float_column,
CASE
WHEN (STR(float_column, 10, 16)) IN ('101', '201') THEN '101,201'
ELSE column
END AS float_column, column2, column3
FROM database.table
ORDER BY float_column
STR(float_column, 10, 16)produce? Have a look: learn.microsoft.com/en-us/sql/t-sql/functions/…