你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
Applies to: ✅Microsoft Fabric✅Azure Data Explorer✅Azure Monitor✅Microsoft Sentinel
从输入中选择要保留在输出中的列。 只有指定为参数的列才会显示在结果中。 其他列会被排除。
Syntax
T| project-keepColumnNameOrPattern [, ...]
Learn more about syntax conventions.
Parameters
| Name | 类型 | Required | Description |
|---|---|---|---|
| T | string |
✔️ | 要从中保留列的表格输入。 |
| ColumnNameOrPattern | string |
✔️ | 要保留在输出中的一个或多个列名或列通配符模式。 |
Returns
一个包含指定为参数的列的表。 包含与输入表相同的行数。
Tip
可以 project-keep 存在于原始表中或已作为查询的一部分进行计算的任何列。
Note
结果中列的顺序取决于列在表中的原始顺序。 仅保留已指定为参数的列。 将从结果中排除其他列。
Example
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. 可能需要修改示例查询中的表名称以匹配工作区中的表。
此查询从包含单词“session”的 ConferenceSessions 表中返回列。
ConferenceSessions
| project-keep session*
Output
输出表仅显示前 10 个结果。
| sessionid | session_title | session_type | session_location |
|---|---|---|---|
| COM64 | 焦点组:Azure 数据资源管理器 | Focus Group | Online |
| COM65 | 焦点组:Azure 数据资源管理器 | Focus Group | Online |
| COM08 | 咨询团队:Azure 数据资源管理器 | 咨询团队 | Online |
| COM137 | 焦点组:Azure 数据资源管理器中的内置仪表板和智能自动缩放功能 | Focus Group | Online |
| CON-PRT157 | 圆桌会议:监视和管理 Azure 数据资源管理器部署 | Roundtable | Online |
| CON-PRT103 | 圆桌会议:高级 Kusto 查询语言主题 | Roundtable | Online |
| CON-PRT157 | 圆桌会议:监视和管理 Azure 数据资源管理器部署 | Roundtable | Online |
| CON-PRT103 | 圆桌会议:高级 Kusto 查询语言主题 | Roundtable | Online |
| CON-PRT130 | 圆桌会议:使用 Azure 数据资源管理器进行数据浏览和可视化 | Roundtable | Online |
| CON-PRT130 | 圆桌会议:使用 Azure 数据资源管理器进行数据浏览和可视化 | Roundtable | Online |
| ... | ... | ... | ... |
Related content
- To choose what columns from the input to exclude from the output, use project-away.
- 若要重命名列,请使用
project-rename。 - 若要对列重新排序,请使用
project-reorder。