The ORDER BY clause is invalid in views, inline functions, derived tables, subqueries, and common ta.
https://stackoverflow.com/questions/30045871/sorting-the-view-based-on-frequency-in-sql-serverJustlikeinsubqueries,youcan'tuseORDERBYinaviewdefinitioninsqlserverunlessyoualsouseTOP.Thereasonforthisist