Table Select (Analysis)

Selects table records matching a Structured Query Language (SQL) expression and writes them to an output table.

Usage

Parameters

Input Table

The table containing records matching the specified expression that will be written to the output table.

Output Table

The output table containing records from the input table that match the specified expression.

Expression

An SQL expression used to select a subset of records.

An SQL expression used to select a subset of records. For more information on SQL syntax, see SQL reference for elements used in query expressions.

arcpy.analysis.TableSelect(in_table, out_table, )

The table containing records matching the specified expression that will be written to the output table.

The output table containing records from the input table that match the specified expression.

where_clause

An SQL expression used to select a subset of records. For more information on SQL syntax, see SQL reference for elements used in query expressions.

Code sample

TableSelect example ( Python window)

The following Python window script demonstrates how to use the TableSelect function in immediate mode.

import arcpy arcpy.env.workspace = "C:/data" arcpy.analysis.TableSelect("majorrds.shp", "C:/output/majorrdsCl4.shp", '"CLASS" = \'4\'')
TableSelect example 2 (stand-alone script)

The following Python script demonstrates how to use the TableSelect function in a stand-alone script.

# 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)

Environments

Licensing information