Difference between quotation marks ('single' vs “double”) in QGIS

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
2
down vote

favorite












I am not a new QGIS user, however, I am still confused concerning the quotation marks syntax ('single' vs "double").



I know something about the quotation marks and the way they are applied in Python scripting (i.e. comments, strings etc.).



There are even some related questions:



  • Single quotes vs. double quotes in Python [closed]

  • Is there any difference between “string” and 'string' in Python? [duplicate]

Nevertheless, I would like to clarify the details regarding the quotation marks ('single' vs "double") in the scope of QGIS.



For instance, if I type something in the Expression dialogue I will have a different output.




  • "something", it is written as

something1



The Output is NULL.




  • 'something', it is shown as

something2



The output is 'something' as a string.



So, my questions are:



  1. What is the syntax/meaningful difference between quotation marks ('single' vs "double") in QGIS?

  2. Are there any other circumstances when other types of quotation marks are used in QGIS, for instance, triple quotation marks as in Python?









share|improve this question



























    up vote
    2
    down vote

    favorite












    I am not a new QGIS user, however, I am still confused concerning the quotation marks syntax ('single' vs "double").



    I know something about the quotation marks and the way they are applied in Python scripting (i.e. comments, strings etc.).



    There are even some related questions:



    • Single quotes vs. double quotes in Python [closed]

    • Is there any difference between “string” and 'string' in Python? [duplicate]

    Nevertheless, I would like to clarify the details regarding the quotation marks ('single' vs "double") in the scope of QGIS.



    For instance, if I type something in the Expression dialogue I will have a different output.




    • "something", it is written as

    something1



    The Output is NULL.




    • 'something', it is shown as

    something2



    The output is 'something' as a string.



    So, my questions are:



    1. What is the syntax/meaningful difference between quotation marks ('single' vs "double") in QGIS?

    2. Are there any other circumstances when other types of quotation marks are used in QGIS, for instance, triple quotation marks as in Python?









    share|improve this question

























      up vote
      2
      down vote

      favorite









      up vote
      2
      down vote

      favorite











      I am not a new QGIS user, however, I am still confused concerning the quotation marks syntax ('single' vs "double").



      I know something about the quotation marks and the way they are applied in Python scripting (i.e. comments, strings etc.).



      There are even some related questions:



      • Single quotes vs. double quotes in Python [closed]

      • Is there any difference between “string” and 'string' in Python? [duplicate]

      Nevertheless, I would like to clarify the details regarding the quotation marks ('single' vs "double") in the scope of QGIS.



      For instance, if I type something in the Expression dialogue I will have a different output.




      • "something", it is written as

      something1



      The Output is NULL.




      • 'something', it is shown as

      something2



      The output is 'something' as a string.



      So, my questions are:



      1. What is the syntax/meaningful difference between quotation marks ('single' vs "double") in QGIS?

      2. Are there any other circumstances when other types of quotation marks are used in QGIS, for instance, triple quotation marks as in Python?









      share|improve this question















      I am not a new QGIS user, however, I am still confused concerning the quotation marks syntax ('single' vs "double").



      I know something about the quotation marks and the way they are applied in Python scripting (i.e. comments, strings etc.).



      There are even some related questions:



      • Single quotes vs. double quotes in Python [closed]

      • Is there any difference between “string” and 'string' in Python? [duplicate]

      Nevertheless, I would like to clarify the details regarding the quotation marks ('single' vs "double") in the scope of QGIS.



      For instance, if I type something in the Expression dialogue I will have a different output.




      • "something", it is written as

      something1



      The Output is NULL.




      • 'something', it is shown as

      something2



      The output is 'something' as a string.



      So, my questions are:



      1. What is the syntax/meaningful difference between quotation marks ('single' vs "double") in QGIS?

      2. Are there any other circumstances when other types of quotation marks are used in QGIS, for instance, triple quotation marks as in Python?






      qgis python syntax






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited 34 mins ago

























      asked 41 mins ago









      Taras

      1,2361520




      1,2361520




















          3 Answers
          3






          active

          oldest

          votes

















          up vote
          2
          down vote













          Double quotes indicate that the string represents the name of an attribute while a single quote is a literal string.



          So in your first case you get NULL because you don't have an attribute called something.






          share|improve this answer



























            up vote
            1
            down vote













            Double marks refer to columns in the attribute table, single marks to a value. E.g. CASE WHEN "something" > '100' THEN 'a lot' ELSE 'not so much' checks the size of values in your column and adds content to fields in the attribute table based on that size.






            share|improve this answer



























              up vote
              1
              down vote













              Here is the answer directly from QGIS help:




              column name "column name" → Value of the field column name, take care
              to not be confused with simple quote, see below



              'string' → a string value, take care to not be confused with double
              quote, see above







              share|improve this answer




















                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%2f301566%2fdifference-between-quotation-marks-single-vs-double-in-qgis%23new-answer', 'question_page');

                );

                Post as a guest






























                3 Answers
                3






                active

                oldest

                votes








                3 Answers
                3






                active

                oldest

                votes









                active

                oldest

                votes






                active

                oldest

                votes








                up vote
                2
                down vote













                Double quotes indicate that the string represents the name of an attribute while a single quote is a literal string.



                So in your first case you get NULL because you don't have an attribute called something.






                share|improve this answer
























                  up vote
                  2
                  down vote













                  Double quotes indicate that the string represents the name of an attribute while a single quote is a literal string.



                  So in your first case you get NULL because you don't have an attribute called something.






                  share|improve this answer






















                    up vote
                    2
                    down vote










                    up vote
                    2
                    down vote









                    Double quotes indicate that the string represents the name of an attribute while a single quote is a literal string.



                    So in your first case you get NULL because you don't have an attribute called something.






                    share|improve this answer












                    Double quotes indicate that the string represents the name of an attribute while a single quote is a literal string.



                    So in your first case you get NULL because you don't have an attribute called something.







                    share|improve this answer












                    share|improve this answer



                    share|improve this answer










                    answered 38 mins ago









                    Ian Turton♦

                    46.1k544106




                    46.1k544106






















                        up vote
                        1
                        down vote













                        Double marks refer to columns in the attribute table, single marks to a value. E.g. CASE WHEN "something" > '100' THEN 'a lot' ELSE 'not so much' checks the size of values in your column and adds content to fields in the attribute table based on that size.






                        share|improve this answer
























                          up vote
                          1
                          down vote













                          Double marks refer to columns in the attribute table, single marks to a value. E.g. CASE WHEN "something" > '100' THEN 'a lot' ELSE 'not so much' checks the size of values in your column and adds content to fields in the attribute table based on that size.






                          share|improve this answer






















                            up vote
                            1
                            down vote










                            up vote
                            1
                            down vote









                            Double marks refer to columns in the attribute table, single marks to a value. E.g. CASE WHEN "something" > '100' THEN 'a lot' ELSE 'not so much' checks the size of values in your column and adds content to fields in the attribute table based on that size.






                            share|improve this answer












                            Double marks refer to columns in the attribute table, single marks to a value. E.g. CASE WHEN "something" > '100' THEN 'a lot' ELSE 'not so much' checks the size of values in your column and adds content to fields in the attribute table based on that size.







                            share|improve this answer












                            share|improve this answer



                            share|improve this answer










                            answered 36 mins ago









                            Erik

                            2,13417




                            2,13417




















                                up vote
                                1
                                down vote













                                Here is the answer directly from QGIS help:




                                column name "column name" → Value of the field column name, take care
                                to not be confused with simple quote, see below



                                'string' → a string value, take care to not be confused with double
                                quote, see above







                                share|improve this answer
























                                  up vote
                                  1
                                  down vote













                                  Here is the answer directly from QGIS help:




                                  column name "column name" → Value of the field column name, take care
                                  to not be confused with simple quote, see below



                                  'string' → a string value, take care to not be confused with double
                                  quote, see above







                                  share|improve this answer






















                                    up vote
                                    1
                                    down vote










                                    up vote
                                    1
                                    down vote









                                    Here is the answer directly from QGIS help:




                                    column name "column name" → Value of the field column name, take care
                                    to not be confused with simple quote, see below



                                    'string' → a string value, take care to not be confused with double
                                    quote, see above







                                    share|improve this answer












                                    Here is the answer directly from QGIS help:




                                    column name "column name" → Value of the field column name, take care
                                    to not be confused with simple quote, see below



                                    'string' → a string value, take care to not be confused with double
                                    quote, see above








                                    share|improve this answer












                                    share|improve this answer



                                    share|improve this answer










                                    answered 27 mins ago









                                    ahmadhanb

                                    20.1k21847




                                    20.1k21847



























                                         

                                        draft saved


                                        draft discarded















































                                         


                                        draft saved


                                        draft discarded














                                        StackExchange.ready(
                                        function ()
                                        StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fgis.stackexchange.com%2fquestions%2f301566%2fdifference-between-quotation-marks-single-vs-double-in-qgis%23new-answer', 'question_page');

                                        );

                                        Post as a guest













































































                                        Comments

                                        Popular posts from this blog

                                        List of Gilmore Girls characters

                                        What does second last employer means? [closed]

                                        One-line joke