I has a scalar valued function that takes an integer as one of it's input. I need a query that runs that function for the set of integers (1,2,3,4,5)
. This is what I have done so far:
SELECT dbo.MyFunction('2016-05-13', Number)
FROM (SELECT TOP 5 ROW_NUMBER() OVER (ORDER BY (SELECT NULL)) AS Number FROM SomeTable) AS T
And this works. Is there a way I can do it without the FROM SomeTable
since I don't actually use any information contained in the table?
Alternatively, is there a cleaner way to write the entire query?