ArcGIS Desktop

  • ArcGIS Pro
  • ArcMap

  • My Profile
  • Help
  • Sign Out
ArcGIS Desktop

ArcGIS Online

The mapping platform for your organization

ArcGIS Desktop

A complete professional GIS

ArcGIS Enterprise

GIS in your enterprise

ArcGIS for Developers

Tools to build location-aware apps

ArcGIS Solutions

Free template maps and apps for your industry

ArcGIS Marketplace

Get apps and data for your organization

  • Documentation
  • Support
Esri
  • Sign In
user
  • My Profile
  • Sign Out

ArcMap

  • Home
  • Get Started
  • Map
  • Analyze
  • Manage Data
  • Tools
  • Extensions

Table Select

  • Summary
  • Usage
  • Syntax
  • Code sample
  • Environments
  • Licensing information

Summary

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

Usage

  • The input can be an INFO, dBASE, or geodatabase table, a feature class, table view, or VPF dataset.

  • The Expression parameter can be created with the Query Builder or simply typed in. For details on the expression syntax, see Building an SQL Expression or SQL Reference.

  • If a table view is used for Input Table and no expression is entered, only the selected records are written to the output table. If a table view is used for input table and an expression is entered, the expression is only executed against the selected records, and the expression-based subset of the selected set is written to the output table.

  • To create a table from the table view's selected set of records, use the Copy Rows (management) tool.

Syntax

TableSelect(in_table, out_table, {where_clause})
ParameterExplanationData Type
in_table

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

Table View; Raster Layer
out_table

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

Table
where_clause
(Optional)

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.

SQL Expression

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.TableSelect_analysis("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\''

# Execute TableSelect
arcpy.TableSelect_analysis(in_features, out_feature_class, where_clause)

Environments

  • Output CONFIG Keyword

Licensing information

  • Basic: Yes
  • Standard: Yes
  • Advanced: Yes

Related topics

  • An overview of the Extract toolset

ArcGIS Desktop

  • Home
  • Documentation
  • Support

ArcGIS Platform

  • ArcGIS Online
  • ArcGIS Desktop
  • ArcGIS Enterprise
  • ArcGIS for Developers
  • ArcGIS Solutions
  • ArcGIS Marketplace

About Esri

  • About Us
  • Careers
  • Esri Blog
  • User Conference
  • Developer Summit
Esri
Tell us what you think.
Copyright © 2019 Esri. | Privacy | Legal