There is the Field Calculator
which has a lot of functionalities. Then there is Select by Expression
which has a SQL Style Syntax.
However, is it possible to write plain SQL in QGIS on a Layer like a shapefile or geopackage?
-
1yes, via a virtual layer– JGHCommented Feb 17, 2022 at 16:59
Add a comment
|
1 Answer
No, the tool Select by Expression
is not using proper SQL. It's QGIS Expression. https://docs.qgis.org/latest/en/docs/user_manual/working_with_vector/expression.html
It has its own syntax. But it works for any layer provider : ogr, geopackage, postgresql, csv as long as you have loaded the layer in QGIS.
-
I know that, that is why I am asking if there is a specific tool that uses SQL :) Commented Feb 18, 2022 at 8:02
-
Well, your question is not really clear. Can you copy paste exactly your query as an example ? Virtual layer might be ok ? Layer properties -> Source -> Query builder is SQL dialect on shapefile etc, but for filtering. What is the final goal, select, extract, filter ? Commented Feb 18, 2022 at 16:04