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.



enter image description here










share|improve this question




























    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.



    enter image description here










    share|improve this question


























      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.



      enter image description here










      share|improve this question















      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.



      enter image description here







      qgis query select-by-attribute






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 7 at 21:02









      csk

      6,067733




      6,067733










      asked Nov 7 at 12:58









      Paul G

      1114




      1114






















          2 Answers
          2






          active

          oldest

          votes

















          up vote
          10
          down vote













          How about "ONScode" != '17UB'



          != means "not equal to".






          share|improve this answer





















          • That works thanks you,
            – Paul G
            Nov 7 at 13:03


















          up vote
          6
          down vote













          Easy way: Select '17UB' manually, then invert the selected features.



          By code: "ONScode" NOT LIKE '17UB'






          share|improve this answer

















          • 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











          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "79"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          convertImagesToLinks: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














           

          draft saved


          draft discarded


















          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
































          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".






          share|improve this answer





















          • That works thanks you,
            – Paul G
            Nov 7 at 13:03















          up vote
          10
          down vote













          How about "ONScode" != '17UB'



          != means "not equal to".






          share|improve this answer





















          • That works thanks you,
            – Paul G
            Nov 7 at 13:03













          up vote
          10
          down vote










          up vote
          10
          down vote









          How about "ONScode" != '17UB'



          != means "not equal to".






          share|improve this answer












          How about "ONScode" != '17UB'



          != means "not equal to".







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Nov 7 at 13:01









          Alex Hajnal

          43929




          43929












          • 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




          That works thanks you,
          – Paul G
          Nov 7 at 13:03












          up vote
          6
          down vote













          Easy way: Select '17UB' manually, then invert the selected features.



          By code: "ONScode" NOT LIKE '17UB'






          share|improve this answer

















          • 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















          up vote
          6
          down vote













          Easy way: Select '17UB' manually, then invert the selected features.



          By code: "ONScode" NOT LIKE '17UB'






          share|improve this answer

















          • 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













          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'






          share|improve this answer












          Easy way: Select '17UB' manually, then invert the selected features.



          By code: "ONScode" NOT LIKE '17UB'







          share|improve this answer












          share|improve this answer



          share|improve this answer










          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














          • 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


















           

          draft saved


          draft discarded



















































           


          draft saved


          draft discarded














          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




















































































          Popular posts from this blog

          Schultheiß

          Liste der Kulturdenkmale in Wilsdruff

          Android Play Services Check