Improvement of data search with QGIS

When working in a GIS environment, many times you will find the need to select data to delete, edit or display. There are many ways that will help you select high amounts of data in a short period of time.

On this occasion, we will talk about the use of “%” and “_” characters in the SQL language in a GIS environment. These characters are useful to search for data that has a letter or number in a particular position.

1. "_"

It lets us indicate the space of a letter or number, taking any value that exists in the database. The underscore represents a single character.

Example:

We have numbers from 15 to 37 and we want to select terms that end in 5:

“%”

Represents letters or numbers that are located before or after the reference character. It can represent zero, one or multiple characters.

Example:

We have river names and want to select the ones that end with the letter A:

It is also possible to use both characters together.

 

These characters can be used in alpha-numerics data.

We recommend you to apply these characters in the Advanced Filter of the Attribute Table because, when we try to use it as Query, it presents some error with numerical data.

Saul Montoya

Saul Montoya es Ingeniero Civil graduado de la Pontificia Universidad Católica del Perú en Lima con estudios de postgrado en Manejo e Ingeniería de Recursos Hídricos (Programa WAREM) de la Universidad de Stuttgart con mención en Ingeniería de Aguas Subterráneas y Hidroinformática.

Smiley face

Subscribe to our free e-newsletter for tutorials, articles, webminars, courses and more.