I guess 'null' is not the same as null. This is a MS SQL Server forum and limit 1 is not supported by MS SQL; this is how I would solve it with T-SQL:
DROP TABLE IF EXISTS #Numm;
SELECT 8 AS Numm
INTO #Numm
UNION ALL
SELECT 8
UNION ALL
SELECT 3
UNION ALL
SELECT 3
--UNION ALL
--SELECT 1
--UNION ALL
--SELECT 4
--UNION ALL
--SELECT 5
--UNION ALL
--SELECT 6;
SELECT * FROM #Numm;
WITH SingleNumber AS
(
SELECT
Numm, ROW_NUMBER() OVER(ORDER BY Numm DESC) AS RowNumber
FROM #Numm
GROUP BY Numm
HAVING COUNT(*) =1
UNION ALL
SELECT
NULL, NULL
)
SELECT MAX(Numm) AS Numm
FROM SingleNumber
WHERE RowNumber=1 OR RowNumber IS NULL;