欢迎投稿

今日深度:

select查询的执行顺序

select查询的执行顺序


一些不知道为什么执行出错的SQl语句,往往是因为你不了解他的执行顺序。

Select distinct top n [percent] 列名

from 表名

where 条件

group by ... having ...

order by ... asc/desc

执行顺序

1>...from 表

2>...where 条件

3>...group by 列

4>...having 筛选条件

5>...Select >选择列 >distinct

6>...order by 列

7>...Top(最后计算)

www.htsjk.Com true http://www.htsjk.com/sybase/19561.html NewsArticle select查询的执行顺序 一些不知道为什么执行出错的SQl语句,往往是因为你不了解他的执行顺序。 Select distinct top n [percent] 列名 from 表名 where 条件 group by ... having ... order by ... asc/desc 执行...
评论暂时关闭