re: Challenge: Get Closest Number in an Array VIEW POST

VIEW PARENT COMMENT VIEW FULL DISCUSSION
 
 

I looked at it again just now and the row_number is redundant anyway...

SELECT unnest
FROM unnest(ARRAY[100,200,400,800,1600,3200,6400,128000])
ORDER BY abs(900 - unnest)
LIMIT 1;
code of conduct - report abuse