Reputation: 93
I want to create function that's return a sorted table based in a column value, I know that's order by doesn't work in function or view a searched her and in others website but I didn't find any things, so my idea is to use a basic ALGORITHME like in C or C++
Upvotes: 0
Views: 102
Reputation: 48177
You cant make a function return the data in any order.
You just order the result
SELECT *
FROM dbo.someFunction ()
ORDER BY somefield
Read:
Do clustered index on a column GUARANTEES returning sorted rows according to that column How does sql server sort your data?
Upvotes: 2