查詢關鍵字 (C# 參考)Query keywords (C# Reference)

本節包含查詢運算式中所使用的內容關鍵字。This section contains the contextual keywords used in query expressions.

本節內容In this section

子句Clause 說明Description
fromfrom 指定資料來源和範圍變數 (與反覆運算變數類似)。Specifies a data source and a range variable (similar to an iteration variable).
wherewhere 根據以邏輯 AND 和 OR 運算子區隔的一或多個布林運算式,以篩選來源項目 (&&||)。Filters source elements based on one or more Boolean expressions separated by logical AND and OR operators ( && or || ).
selectselect 指定在執行查詢時,所傳回序列中的項目會有的類型和形狀。Specifies the type and shape that the elements in the returned sequence will have when the query is executed.
groupgroup 根據指定的索引鍵值來群組查詢結果。Groups query results according to a specified key value.
intointo 提供可作為 join、group 或 select 子句結果參考的識別碼。Provides an identifier that can serve as a reference to the results of a join, group or select clause.
orderbyorderby 根據項目類型的預設比較子,以遞增或遞減順序來排序查詢結果。Sorts query results in ascending or descending order based on the default comparer for the element type.
joinjoin 根據兩個指定比對準則的相等比較,以聯結兩個資料來源。Joins two data sources based on an equality comparison between two specified matching criteria.
letlet 引進範圍變數以儲存查詢運算式中的子運算式結果。Introduces a range variable to store sub-expression results in a query expression.
inin join 子句中的內容關鍵字。Contextual keyword in a join clause.
onon join 子句中的內容關鍵字。Contextual keyword in a join clause.
equalsequals join 子句中的內容關鍵字。Contextual keyword in a join clause.
byby group 子句中的內容關鍵字。Contextual keyword in a group clause.
ascendingascending orderby 子句中的內容關鍵字。Contextual keyword in an orderby clause.
descendingdescending orderby 子句中的內容關鍵字。Contextual keyword in an orderby clause.

另請參閱See also