1

i have added a connection with a MySQL database in QGIS (Add vector layer - Database - MySQL).

Is there an option to make a query over the database in QGIS?

Vince
20.5k16 gold badges49 silver badges65 bronze badges
asked Jun 4, 2019 at 12:06

1 Answer 1

2

You can achieve this using the DB Manager of QGIS.

You choose Database / Database Manager / Database Manager then Virtual Layers / Qgis Layers. At this stage you should be able to see all the tables opened (MySql, Postgre ...)

You can query these tables like any opened table : just click on the "wrench" icon ("SQL window") - this open an area in which u can edit your SQL query.

You can then load the result in the layer manager.

answered Jun 7, 2019 at 15:05

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.