arcpy.analysis.TableSelect(in_table, out_table, {where_clause})名称说明数据类型in_table包含与指定表达式匹配的记录的表,匹配记录将被写入输出表。
Table View; Raster Layerout_table包含输入表中与指定表达式匹配的记录的输出表。
Tablewhere_clause(可选)
用于选择记录子集的 SQL 表达式。 有关 SQL 语法的详细信息,请参阅在查询表达式中使用的元素的 SQL 参考。
SQL Expression代码示例TableSelect 示例(Python 窗口)
以下 Python 窗口脚本演示了如何在即时模式下使用 TableSelect 函数。
import arcpy
arcpy.env.workspace = "C:/data"
arcpy.analysis.TableSelect("majorrds.shp", "C:/output/majorrdsCl4.shp", '"CLASS" = \'4\'')TableSelect 示例 2(独立脚本)
以下 Python 脚本演示了如何在独立脚本中使用 TableSelect 函数。
# Name: TableSelect_Example2.py
# Description: Select class4 roads from the major roads gnatcatcher habitat study area
# Import system modules
import arcpy
# Set workspace
arcpy.env.workspace = "C:/data"
# Set local variables
in_features = "majorrds.shp"
out_feature_class = "C:/output/majorrdsCl4.shp"
where_clause = '"CLASS" = \'4\''
# Run TableSelect
arcpy.analysis.TableSelect(in_features, out_feature_class, where_clause)