出个SQL语句执行顺序的题目

select  [distinct]

[top n]  [into 新表名称]

from 表1

[inner | left | right] join 表2 on <表join的条件> 

[where <过滤条件>]

[group by <分组语法>]

[with {cube | rollup}]

[having <过滤条件>]

[order by <排序列表> [asc | desc ] ]

注意点:

1、distinct、order by、top三者的执行顺序如何?

已有7 条评论

发表评论

电子邮件地址不会被公开。 必填项已用*标注

To create code blocks or other preformatted text, indent by four spaces:

    This will be displayed in a monospaced font. The first four 
    spaces will be stripped off, but all other whitespace
    will be preserved.
    
    Markdown is turned off in code blocks:
     [This is not a link](http://example.com)

To create not a block, but an inline code span, use backticks:

Here is some inline `code`.

For more help see http://daringfireball.net/projects/markdown/syntax

您可以使用这些HTML标签和属性: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>