Applies to: ✅Microsoft Fabric✅Azure Data Explorer✅Azure Monitor✅Microsoft Sentinel
新しい計算列を含める、名前を変更する、またはドロップする列を選択し、挿入します。
結果の列の順序は、引数の順序によって指定されます。 結果には、引数で指定された列のみが含まれます。 入力内のその他の列は削除されます
Syntax
T| project [ColumnName | (ColumnName[,])=] Expression [, ...]
or
T| projectColumnName [=Expression] [, ...]
Learn more about syntax conventions.
Parameters
| Name | タイプ | Required | Description |
|---|---|---|---|
| T | string |
✔️ | 特定の列を投影する表形式の入力。 |
| ColumnName | string |
出力に表示される列名またはコンマ区切りの列名の一覧。 | |
| Expression | string |
入力に対して実行するスカラー式。 |
- Either ColumnName or Expression must be specified.
- If there's no Expression, then a column of ColumnName must appear in the input.
- If ColumnName is omitted, the output column name of Expression will be automatically generated.
- If Expression returns more than one column, a list of column names can be specified in parentheses. If a list of the column names isn't specified, all Expression's output columns with generated names will be added to the output.
Note
入力内の既存の列と同じ名前の新しい計算列を返すのはお勧めしません。
Returns
引数として名前を指定された列を含むテーブル。 入力テーブルと同じ数の行を含みます。
Examples
このセクションの例では、構文を使用して作業を開始する方法を示します。
The examples in this article use publicly available tables in the help cluster, such as the
StormEventstable in the Samples database.
The examples in this article use publicly available tables, such as the
Weathertable in the Weather analytics sample gallery. ワークスペース内のテーブルと一致するように、クエリ例のテーブル名を変更する必要がある場合があります。
特定の列のみを表示する
EventId テーブルのState、EventType、StormEventsのみを表示します。
StormEvents
| project EventId, State, EventType
Output
この表は、最初の 10 件の結果を示しています。
| EventId | State | EventType |
|---|---|---|
| 61032 | ATLANTIC SOUTH | Waterspout |
| 60904 | FLORIDA | Heavy Rain |
| 60913 | FLORIDA | Tornado |
| 64588 | GEORGIA | Thunderstorm Wind |
| 68796 | MISSISSIPPI | Thunderstorm Wind |
| 68814 | MISSISSIPPI | Tornado |
| 68834 | MISSISSIPPI | Thunderstorm Wind |
| 68846 | MISSISSIPPI | Hail |
| 73241 | AMERICAN SAMOA | Flash Flood |
| 64725 | KENTUCKY | Flood |
| ... | ... | ... |
プロジェクトを使用した潜在的な操作
次のクエリでは、 BeginLocation 列の名前を変更し、2 つの既存の列に対する計算から TotalInjuries という名前の新しい列を作成します。
StormEvents
| project StartLocation = BeginLocation, TotalInjuries = InjuriesDirect + InjuriesIndirect
| where TotalInjuries > 5
Output
この表は、最初の 10 件の結果を示しています。
| StartLocation | TotalInjuries |
|---|---|
| LYDIA | 15 |
| ROYAL | 15 |
| GOTHENBURG | 9 |
| PLAINS | 8 |
| KNOXVILLE | 9 |
| CAROL STREAM | 11 |
| HOLLY | 9 |
| RUFFIN | 9 |
| ENTERPRISE MUNI ARPT | 50 |
| COLLIERVILLE | 6 |
| ... | ... |