2

I incurring in an error while trying to make the following filter of fields in the layer properties Query builder in QGIS 3 from a PostGIS database.

select "field_A", "field_B2", "field_D" from my_database

what should be the correct sentence to filter fields in the Query builder?

  • that's a select of columns - you only need to use "field_A" = 'value' – DPSSpatial Jun 20 at 17:52
  • The issue is that I have inherited a database with more than 200 fields -I know it's crazy- and I just need to pick 6 or 8 fields... Is there a way to solve it at once? – Rodrigo Vargas Jun 20 at 18:30
2

I dont think you can hide columns using Query builder since what you add there is what comes after select * from table where... which will select rows.

But you can create a virtual layer:

  • Add the non-filtered layer to the map
  • Go to Layer - Create Layer - New Virtual Layer
  • Add your query

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.