程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
 程式師世界 >> 數據庫知識 >> SqlServer數據庫 >> 關於SqlServer >> Hints (Transact-SQL)

Hints (Transact-SQL)

編輯:關於SqlServer

Hints are option or strategies specifIEd for enforcement by the SQL Server query prosessor on SELECT, INSERT, UPDATE, OR DELETE statements. The hints override any execution plan the query optimizer might select for a query.

Caution: Because the SQL Server query optimizer typically selects the best execution plan for a query, we recommend that <join_hint>, <query_hint>, and <table_hint> be used only as a last resort by experIEnced developers and database administrators.

 

Query hints specify that the indicated hints should be used throughout the query. Query hints affect all operators in the statement. If UNION is involved in the main query, only the last query involving a UNION Operation can have the OPTION clause. Query hints are specifIEd as part of the OPTION clause. If one or more query hints causes the query optimizer not to generate a valid plan, error 8622 is raised.

 

RetrIEves rows from the database and enables the selection of one or many rows or columns from one or many tables. The full syntax of the SELECT statement is complex, but the main clauses can be summarized as:

[ WITH <common_table_expression>]

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 ] ]

The UNION, EXCEPT and INTERSECT Operators can be used between querIEs to combine or compare their results into one result set.

  1. 上一頁:
  2. 下一頁:
Copyright © 程式師世界 All Rights Reserved