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
| Parameter | Description | Notes |
|---|---|---|
| Input vector file | The vector file to query with SQL. | Required |
| SQL query statement | The SQL query statement, for example: SELECT * FROM sql_query WHERE population > 1000. | Required |
| Output vector file | The vector output file for the SQL query result. | Required |
Steps
- Start the tool: Open the Geoprocessing Toolbox > go to Vector Tools > Feature Processing > Select > start the Vector SQL Query tool pane.
- 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.
- Set core parameters: Configure the SQL query statement according to your workflow goal. If needed, consider field types, thresholds, and sorting rules.
- Set the output: Specify the Output vector file, and confirm that the output path, format, and naming rules meet downstream requirements.
- 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.