Why use Select Top 100 Percent?

后端 未结 10 2290
花落未央
花落未央 2020-11-27 15:41

I understand that prior to SQL Server 2005, you could \"trick\" SQL Server to allow use of an order by in a view definition, by also include TOP 100 PERCENT

10条回答
  •  南方客
    南方客 (楼主)
    2020-11-27 16:18

    If there is no ORDER BY clause, then TOP 100 PERCENT is redundant. (As you mention, this was the 'trick' with views)

    [Hopefully the optimizer will optimize this away.]

提交回复
热议问题