QGIS Selecting all features except one
up vote
4
down vote
favorite
Using QGIS 2.18. I have 346 polygons on a layer and I want to display all but one.
In this instance I wish to run a query using field ONSCode but show all except 17UB.
I have been trying to use NOT but in the wrong context and get errors.
qgis query select-by-attribute
add a comment |
up vote
4
down vote
favorite
Using QGIS 2.18. I have 346 polygons on a layer and I want to display all but one.
In this instance I wish to run a query using field ONSCode but show all except 17UB.
I have been trying to use NOT but in the wrong context and get errors.
qgis query select-by-attribute
add a comment |
up vote
4
down vote
favorite
up vote
4
down vote
favorite
Using QGIS 2.18. I have 346 polygons on a layer and I want to display all but one.
In this instance I wish to run a query using field ONSCode but show all except 17UB.
I have been trying to use NOT but in the wrong context and get errors.
qgis query select-by-attribute
Using QGIS 2.18. I have 346 polygons on a layer and I want to display all but one.
In this instance I wish to run a query using field ONSCode but show all except 17UB.
I have been trying to use NOT but in the wrong context and get errors.
qgis query select-by-attribute
qgis query select-by-attribute
edited Nov 7 at 21:02
csk
6,067733
6,067733
asked Nov 7 at 12:58
Paul G
1114
1114
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
up vote
10
down vote
How about "ONScode" != '17UB'
!=
means "not equal to".
That works thanks you,
– Paul G
Nov 7 at 13:03
add a comment |
up vote
6
down vote
Easy way: Select '17UB'
manually, then invert the selected features.
By code: "ONScode" NOT LIKE '17UB'
1
LIKE
also does wildcard matching which makes the operator slightly slower (and behave slightly differently) than=
and!=
. For for the string'ABC 123'
the patterns'ABC 123'
,'A%'
,'%3'
and'%C 1%'
all match. The pattern'10%'
matches the string'10%'
but also the string'100%'
. The character_
matches any single character. In QGIS 3 and later you can match a literal%
or_
with\\%
and\\_
. Interestingly, in QGIS wildcards are implemented as regexes under the hood; this means using regexp_match should actually be slightly cheaper than simple wildcards!
– Alex Hajnal
Nov 7 at 21:52
add a comment |
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
10
down vote
How about "ONScode" != '17UB'
!=
means "not equal to".
That works thanks you,
– Paul G
Nov 7 at 13:03
add a comment |
up vote
10
down vote
How about "ONScode" != '17UB'
!=
means "not equal to".
That works thanks you,
– Paul G
Nov 7 at 13:03
add a comment |
up vote
10
down vote
up vote
10
down vote
How about "ONScode" != '17UB'
!=
means "not equal to".
How about "ONScode" != '17UB'
!=
means "not equal to".
answered Nov 7 at 13:01
Alex Hajnal
43929
43929
That works thanks you,
– Paul G
Nov 7 at 13:03
add a comment |
That works thanks you,
– Paul G
Nov 7 at 13:03
That works thanks you,
– Paul G
Nov 7 at 13:03
That works thanks you,
– Paul G
Nov 7 at 13:03
add a comment |
up vote
6
down vote
Easy way: Select '17UB'
manually, then invert the selected features.
By code: "ONScode" NOT LIKE '17UB'
1
LIKE
also does wildcard matching which makes the operator slightly slower (and behave slightly differently) than=
and!=
. For for the string'ABC 123'
the patterns'ABC 123'
,'A%'
,'%3'
and'%C 1%'
all match. The pattern'10%'
matches the string'10%'
but also the string'100%'
. The character_
matches any single character. In QGIS 3 and later you can match a literal%
or_
with\\%
and\\_
. Interestingly, in QGIS wildcards are implemented as regexes under the hood; this means using regexp_match should actually be slightly cheaper than simple wildcards!
– Alex Hajnal
Nov 7 at 21:52
add a comment |
up vote
6
down vote
Easy way: Select '17UB'
manually, then invert the selected features.
By code: "ONScode" NOT LIKE '17UB'
1
LIKE
also does wildcard matching which makes the operator slightly slower (and behave slightly differently) than=
and!=
. For for the string'ABC 123'
the patterns'ABC 123'
,'A%'
,'%3'
and'%C 1%'
all match. The pattern'10%'
matches the string'10%'
but also the string'100%'
. The character_
matches any single character. In QGIS 3 and later you can match a literal%
or_
with\\%
and\\_
. Interestingly, in QGIS wildcards are implemented as regexes under the hood; this means using regexp_match should actually be slightly cheaper than simple wildcards!
– Alex Hajnal
Nov 7 at 21:52
add a comment |
up vote
6
down vote
up vote
6
down vote
Easy way: Select '17UB'
manually, then invert the selected features.
By code: "ONScode" NOT LIKE '17UB'
Easy way: Select '17UB'
manually, then invert the selected features.
By code: "ONScode" NOT LIKE '17UB'
answered Nov 7 at 13:02
Erik
2,35417
2,35417
1
LIKE
also does wildcard matching which makes the operator slightly slower (and behave slightly differently) than=
and!=
. For for the string'ABC 123'
the patterns'ABC 123'
,'A%'
,'%3'
and'%C 1%'
all match. The pattern'10%'
matches the string'10%'
but also the string'100%'
. The character_
matches any single character. In QGIS 3 and later you can match a literal%
or_
with\\%
and\\_
. Interestingly, in QGIS wildcards are implemented as regexes under the hood; this means using regexp_match should actually be slightly cheaper than simple wildcards!
– Alex Hajnal
Nov 7 at 21:52
add a comment |
1
LIKE
also does wildcard matching which makes the operator slightly slower (and behave slightly differently) than=
and!=
. For for the string'ABC 123'
the patterns'ABC 123'
,'A%'
,'%3'
and'%C 1%'
all match. The pattern'10%'
matches the string'10%'
but also the string'100%'
. The character_
matches any single character. In QGIS 3 and later you can match a literal%
or_
with\\%
and\\_
. Interestingly, in QGIS wildcards are implemented as regexes under the hood; this means using regexp_match should actually be slightly cheaper than simple wildcards!
– Alex Hajnal
Nov 7 at 21:52
1
1
LIKE
also does wildcard matching which makes the operator slightly slower (and behave slightly differently) than =
and !=
. For for the string 'ABC 123'
the patterns 'ABC 123'
, 'A%'
, '%3'
and '%C 1%'
all match. The pattern '10%'
matches the string '10%'
but also the string '100%'
. The character _
matches any single character. In QGIS 3 and later you can match a literal %
or _
with \\%
and \\_
. Interestingly, in QGIS wildcards are implemented as regexes under the hood; this means using regexp_match should actually be slightly cheaper than simple wildcards!– Alex Hajnal
Nov 7 at 21:52
LIKE
also does wildcard matching which makes the operator slightly slower (and behave slightly differently) than =
and !=
. For for the string 'ABC 123'
the patterns 'ABC 123'
, 'A%'
, '%3'
and '%C 1%'
all match. The pattern '10%'
matches the string '10%'
but also the string '100%'
. The character _
matches any single character. In QGIS 3 and later you can match a literal %
or _
with \\%
and \\_
. Interestingly, in QGIS wildcards are implemented as regexes under the hood; this means using regexp_match should actually be slightly cheaper than simple wildcards!– Alex Hajnal
Nov 7 at 21:52
add a comment |
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fgis.stackexchange.com%2fquestions%2f301676%2fqgis-selecting-all-features-except-one%23new-answer', 'question_page');
}
);
Post as a guest
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password