<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic When to use Query where: &amp;quot;1=0&amp;quot; in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/when-to-use-query-where-quot-1-0-quot/m-p/1178097#M77512</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am very new to ArcGIS and have "inherited" a project that provides a map on one of our web pages.&amp;nbsp; I am slogging through it and learning a lot, but one thing still stumps me.&amp;nbsp; This code has several instances where it sets the Query 'where' property to '1=0'.&amp;nbsp; Now, to my SQL thinking, adding a where clause such as 1=0, which evaluates to false, would return nothing.&amp;nbsp; However, I have witnessed that something does get returned when I enter the corresponding URL (like the one below).&amp;nbsp; If I change the where to '1=1' much more data is returned, however.&lt;/P&gt;&lt;P&gt;Can anyone please explain the purpose of using a where clause of '1=0'?&lt;/P&gt;&lt;P&gt;https://&amp;lt;URL Returning FeatureLayer&amp;gt;/query?f=json&amp;amp;where=1=0&lt;/P&gt;</description>
    <pubDate>Fri, 27 May 2022 20:37:25 GMT</pubDate>
    <dc:creator>TimDietz</dc:creator>
    <dc:date>2022-05-27T20:37:25Z</dc:date>
    <item>
      <title>When to use Query where: "1=0"</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/when-to-use-query-where-quot-1-0-quot/m-p/1178097#M77512</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am very new to ArcGIS and have "inherited" a project that provides a map on one of our web pages.&amp;nbsp; I am slogging through it and learning a lot, but one thing still stumps me.&amp;nbsp; This code has several instances where it sets the Query 'where' property to '1=0'.&amp;nbsp; Now, to my SQL thinking, adding a where clause such as 1=0, which evaluates to false, would return nothing.&amp;nbsp; However, I have witnessed that something does get returned when I enter the corresponding URL (like the one below).&amp;nbsp; If I change the where to '1=1' much more data is returned, however.&lt;/P&gt;&lt;P&gt;Can anyone please explain the purpose of using a where clause of '1=0'?&lt;/P&gt;&lt;P&gt;https://&amp;lt;URL Returning FeatureLayer&amp;gt;/query?f=json&amp;amp;where=1=0&lt;/P&gt;</description>
      <pubDate>Fri, 27 May 2022 20:37:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/when-to-use-query-where-quot-1-0-quot/m-p/1178097#M77512</guid>
      <dc:creator>TimDietz</dc:creator>
      <dc:date>2022-05-27T20:37:25Z</dc:date>
    </item>
    <item>
      <title>Re: When to use Query where: "1=0"</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/when-to-use-query-where-quot-1-0-quot/m-p/1178106#M77514</link>
      <description>&lt;P&gt;I'm not sure why someone would want that, I suppose it depends. The query would return info about the fields, maybe some other service info, but an empty array of features.&lt;/P&gt;</description>
      <pubDate>Fri, 27 May 2022 21:18:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/when-to-use-query-where-quot-1-0-quot/m-p/1178106#M77514</guid>
      <dc:creator>ReneRubalcava</dc:creator>
      <dc:date>2022-05-27T21:18:58Z</dc:date>
    </item>
    <item>
      <title>Re: When to use Query where: "1=0"</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/when-to-use-query-where-quot-1-0-quot/m-p/1178108#M77515</link>
      <description>&lt;P&gt;Since there's not really a true boolean value in SQL, people use 1=0 or 1=1. You would use 1=0 in some geoprocessing tools (like feature class to feature class) to copy the table structure without the data. Although you can do the same thing using the template parameter with&amp;nbsp;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/tool-reference/data-management/create-table.htm" target="_self"&gt;Create Table&lt;/A&gt; or &lt;A href="https://pro.arcgis.com/en/pro-app/latest/tool-reference/data-management/create-feature-class.htm" target="_self"&gt;Create Feature Class&lt;/A&gt;. In the context of a JS web app, I'm not really sure why you would query where 1=0. I'd have to see it in context.&lt;/P&gt;&lt;P&gt;Using 1=1 will return all rows and is common in web apps when querying a feature layer in order to work with all the data.&lt;/P&gt;</description>
      <pubDate>Fri, 27 May 2022 21:28:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/when-to-use-query-where-quot-1-0-quot/m-p/1178108#M77515</guid>
      <dc:creator>BlakeTerhune</dc:creator>
      <dc:date>2022-05-27T21:28:00Z</dc:date>
    </item>
    <item>
      <title>Re: When to use Query where: "1=0"</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/when-to-use-query-where-quot-1-0-quot/m-p/1178666#M77535</link>
      <description>&lt;P&gt;One of the scenarios where this is used is when populating an OnDemandGrid.&amp;nbsp; After the grid is populated during initialization, there is an icon placed on the map to display the grid.&lt;/P&gt;&lt;P&gt;It may be that the first query (with 1=0) is used to just initialize the grid with nothing.&amp;nbsp; Later in the initialization process, the query is re-issued (with 1=1) to retrieve data and populate the grid.&amp;nbsp; I don't know, yet, but there may be scenarios where the query is never re-issued during initialization.&amp;nbsp; In that case, if we hadn't already initialized the grid, nothing would show at all.&lt;/P&gt;</description>
      <pubDate>Tue, 31 May 2022 17:10:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/when-to-use-query-where-quot-1-0-quot/m-p/1178666#M77535</guid>
      <dc:creator>TimDietz</dc:creator>
      <dc:date>2022-05-31T17:10:43Z</dc:date>
    </item>
  </channel>
</rss>

