Skip to main content

Vector SQL Query

Overview​

Use SQL statements to filter or restructure input vector attribute records and output a new vector result.

This tool treats the input feature attribute table as the SQL query object. It uses statements such as SELECT ... FROM sql_query ... to filter, sort, or project attribute records, and then outputs a new feature dataset.

Use Cases​

  • Batch-select target features by attribute conditions and output a result layer.
  • Quickly restructure attribute tables with SQL or expressions in complex data organization workflows.
  • Prepare input features for subsequent spatial analysis, statistical summaries, or map production.

Parameters​

ParameterDescriptionNotes
Input vector fileThe vector file to query with SQL.Required
SQL query statementThe SQL query statement, for example: SELECT * FROM sql_query WHERE population > 1000.Required
Output vector fileThe vector output file for the SQL query result.Required

Steps​

  1. Start the tool: Open the Geoprocessing Toolbox > go to Vector Tools > Feature Processing > Select > start the Vector SQL Query tool pane.
  2. Prepare the input: Select the Input vector file and enter the SQL query statement. Confirm that the input data is complete and can be read correctly.
  3. Set core parameters: Configure the SQL query statement according to your workflow goal. If needed, consider field types, thresholds, and sorting rules.
  4. Set the output: Specify the Output vector file, and confirm that the output path, format, and naming rules meet downstream requirements.
  5. Run and check the result: Click Run to execute the task. After completion, check whether the result extent, value distribution, field structure, and spatial location meet expectations.

Notes​

  • In SQL statements, use the source-defined table name sql_query. Field names must match the input feature attribute table.