3

I have a polygon layer with 3 fields (A, B and C). I want to create a copy and add as a virtual layer so I use CREATE VIRTUAL LAYER option but only want the first field.

So I use the expression Select A from "polygon layer"

But it doesnt work. What is wrong with my expression? The fields only contain string values. Do I need to specify geometry column?

This expression works Select * from "polygon layer but takes all fields.

asked Sep 17, 2018 at 9:59

1 Answer 1

4

You forget the 4th field: geometry. It is not shown as a column, but it is there. If you do select * from layer, then in fact you call select geometry, A, B, C from layer.

So, if you want to load a copy of the original with only column 'A', you also have to call the geometry into the expression:

select geometry, A from layer
answered Sep 17, 2018 at 10:19

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.