What is the correct order of these clauses while writing a SQL query?

前端 未结 3 1247
野性不改
野性不改 2020-12-15 19:18

There are many clauses in SQL Server such as SELECT, WHERE, GROUP BY, ORDER BY, HAVING

What is the c

3条回答
  •  太阳男子
    2020-12-15 19:51

    http://msdn.microsoft.com/en-us/library/ms189499.aspx

    [ WITH ]
    
    SELECT select_list [ INTO new_table ]
    
    [ FROM table_source ] [ WHERE search_condition ]
    
    [ GROUP BY group_by_expression ]
    
    [ HAVING search_condition ]
    
    [ ORDER BY order_expression [ ASC | DESC ] ]
    

提交回复
热议问题