<?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>question How to write a &amp;quot;where clause&amp;quot; in a database view in ITSM forum</title>
    <link>https://www.servicenow.com/community/itsm-forum/how-to-write-a-quot-where-clause-quot-in-a-database-view/m-p/3190612#M536386</link>
    <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1. After creating a database view , adding the tables you want to combine , how to define where clause?&lt;/P&gt;&lt;P&gt;2. How do we know which one to write where clause for??&lt;/P&gt;&lt;P&gt;3.&amp;nbsp;For example, see the picture below,&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="vishnumaaya_0-1740660780885.jpeg" style="width: 999px;"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/422557i940719E76F73A093/image-size/large/is-moderation-mode/true?v=v2&amp;amp;px=999" role="button" title="vishnumaaya_0-1740660780885.jpeg" alt="vishnumaaya_0-1740660780885.jpeg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;- How to judge where to write the Where clause? as in where clause is written near the change_request and not task_sla&amp;nbsp;&lt;/P&gt;&lt;P&gt;- Why was it written in change request where clause?&lt;/P&gt;&lt;P&gt;- Why did it not use change_request_sla table n used task_sla table??&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please share any article, blog or videos if you have.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Vaishnavi&lt;/P&gt;</description>
    <pubDate>Thu, 27 Feb 2025 12:57:52 GMT</pubDate>
    <dc:creator>vishnumaaya</dc:creator>
    <dc:date>2025-02-27T12:57:52Z</dc:date>
    <item>
      <title>How to write a "where clause" in a database view</title>
      <link>https://www.servicenow.com/community/itsm-forum/how-to-write-a-quot-where-clause-quot-in-a-database-view/m-p/3190612#M536386</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1. After creating a database view , adding the tables you want to combine , how to define where clause?&lt;/P&gt;&lt;P&gt;2. How do we know which one to write where clause for??&lt;/P&gt;&lt;P&gt;3.&amp;nbsp;For example, see the picture below,&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="vishnumaaya_0-1740660780885.jpeg" style="width: 999px;"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/422557i940719E76F73A093/image-size/large/is-moderation-mode/true?v=v2&amp;amp;px=999" role="button" title="vishnumaaya_0-1740660780885.jpeg" alt="vishnumaaya_0-1740660780885.jpeg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;- How to judge where to write the Where clause? as in where clause is written near the change_request and not task_sla&amp;nbsp;&lt;/P&gt;&lt;P&gt;- Why was it written in change request where clause?&lt;/P&gt;&lt;P&gt;- Why did it not use change_request_sla table n used task_sla table??&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please share any article, blog or videos if you have.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Vaishnavi&lt;/P&gt;</description>
      <pubDate>Thu, 27 Feb 2025 12:57:52 GMT</pubDate>
      <guid>https://www.servicenow.com/community/itsm-forum/how-to-write-a-quot-where-clause-quot-in-a-database-view/m-p/3190612#M536386</guid>
      <dc:creator>vishnumaaya</dc:creator>
      <dc:date>2025-02-27T12:57:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to write a "where clause" in a database view</title>
      <link>https://www.servicenow.com/community/itsm-forum/how-to-write-a-quot-where-clause-quot-in-a-database-view/m-p/3190664#M536391</link>
      <description>&lt;P&gt;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/828761"&gt;@vishnumaaya&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Explanation here:&lt;/P&gt;
&lt;P&gt;1) row 1 is for change_request, it should be with 100 order&lt;/P&gt;
&lt;P&gt;2) row 2 is for task_sla, it should have where clause and should be with 200 order&lt;/P&gt;
&lt;P&gt;You can write where clause in any row but ensure it's correct with correct prefix&lt;/P&gt;
&lt;P&gt;- Why did it not use change_request_sla table n used task_sla table??&lt;STRONG&gt; -&amp;gt; this might be as per customer requirement as SLAs are stored in task_sla table&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;If my response helped please mark it correct and close the thread so that it benefits future readers.&lt;/P&gt;</description>
      <pubDate>Thu, 27 Feb 2025 13:35:47 GMT</pubDate>
      <guid>https://www.servicenow.com/community/itsm-forum/how-to-write-a-quot-where-clause-quot-in-a-database-view/m-p/3190664#M536391</guid>
      <dc:creator>Ankur Bawiskar</dc:creator>
      <dc:date>2025-02-27T13:35:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to write a "where clause" in a database view</title>
      <link>https://www.servicenow.com/community/itsm-forum/how-to-write-a-quot-where-clause-quot-in-a-database-view/m-p/3190672#M536392</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/828761"&gt;@vishnumaaya&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;- How to judge where to write the Where clause? as in where clause is written near the change_request and not task_sla&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Atul: it is mainly on main table like where is main record exists.&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;-&lt;/P&gt;
&lt;P&gt;- Why did it not use change_request_sla table n used task_sla table??&lt;/P&gt;
&lt;P&gt;Atul: The Sla stored in task_sla table and i.e. reason we use task_sla.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://support.servicenow.com/kb?id=kb_article_view&amp;amp;sysparm_article=KB0719186" target="_blank"&gt;https://support.servicenow.com/kb?id=kb_article_view&amp;amp;sysparm_article=KB0719186&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Feb 2025 13:38:43 GMT</pubDate>
      <guid>https://www.servicenow.com/community/itsm-forum/how-to-write-a-quot-where-clause-quot-in-a-database-view/m-p/3190672#M536392</guid>
      <dc:creator>Dr Atul G- LNG</dc:creator>
      <dc:date>2025-02-27T13:38:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to write a "where clause" in a database view</title>
      <link>https://www.servicenow.com/community/itsm-forum/how-to-write-a-quot-where-clause-quot-in-a-database-view/m-p/3190679#M536393</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/828761"&gt;@vishnumaaya&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;Refer to this example :&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.servicenow.com/community/training-and-certifications/database-view-quot-where-clause-quot-question/m-p/2954031" target="_blank"&gt;https://www.servicenow.com/community/training-and-certifications/database-view-quot-where-clause-quot-question/m-p/2954031&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.servicenow.com/community/itsm-forum/database-view-where-clause/m-p/2474805" target="_blank"&gt;https://www.servicenow.com/community/itsm-forum/database-view-where-clause/m-p/2474805&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Feb 2025 13:41:29 GMT</pubDate>
      <guid>https://www.servicenow.com/community/itsm-forum/how-to-write-a-quot-where-clause-quot-in-a-database-view/m-p/3190679#M536393</guid>
      <dc:creator>Community Alums</dc:creator>
      <dc:date>2025-02-27T13:41:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to write a "where clause" in a database view</title>
      <link>https://www.servicenow.com/community/itsm-forum/how-to-write-a-quot-where-clause-quot-in-a-database-view/m-p/3190791#M536395</link>
      <description>&lt;P&gt;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/828761"&gt;@vishnumaaya&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you for marking my response as helpful.&lt;/P&gt;
&lt;P&gt;If my response helped please mark it correct and close the thread so that it benefits future readers.&lt;/P&gt;</description>
      <pubDate>Thu, 27 Feb 2025 14:50:17 GMT</pubDate>
      <guid>https://www.servicenow.com/community/itsm-forum/how-to-write-a-quot-where-clause-quot-in-a-database-view/m-p/3190791#M536395</guid>
      <dc:creator>Ankur Bawiskar</dc:creator>
      <dc:date>2025-02-27T14:50:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to write a "where clause" in a database view</title>
      <link>https://www.servicenow.com/community/itsm-forum/how-to-write-a-quot-where-clause-quot-in-a-database-view/m-p/3191381#M536407</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/828761"&gt;@vishnumaaya&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 28 Feb 2025 02:17:28 GMT</pubDate>
      <guid>https://www.servicenow.com/community/itsm-forum/how-to-write-a-quot-where-clause-quot-in-a-database-view/m-p/3191381#M536407</guid>
      <dc:creator>Community Alums</dc:creator>
      <dc:date>2025-02-28T02:17:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to write a "where clause" in a database view</title>
      <link>https://www.servicenow.com/community/itsm-forum/how-to-write-a-quot-where-clause-quot-in-a-database-view/m-p/3191403#M536408</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/828761"&gt;@vishnumaaya&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please refer below thread &amp;amp; videos:&lt;BR /&gt;&lt;A href="https://www.servicenow.com/community/developer-forum/database-view/td-p/1459496" target="_blank"&gt;Solved: Database View - ServiceNow Community&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://support.servicenow.com/kb?id=kb_article_view&amp;amp;sysparm_article=KB0719186" target="_blank"&gt;https://support.servicenow.com/kb?id=kb_article_view&amp;amp;sysparm_article=KB0719186&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.servicenow.com/docs/csh?topicname=c_DatabaseViews.html&amp;amp;version=latest" target="_blank"&gt;https://www.servicenow.com/docs/csh?topicname=c_DatabaseViews.html&amp;amp;version=latest&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://youtu.be/_JY462TmXxU?si=2OvPCBW_Ecid4flE" target="_blank"&gt;https://youtu.be/_JY462TmXxU?si=2OvPCBW_Ecid4flE&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://youtu.be/vk1MYBxTSxY?si=j-Y1f0BFCdknobJT" target="_blank"&gt;https://youtu.be/vk1MYBxTSxY?si=j-Y1f0BFCdknobJT&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://youtu.be/vJo3BG2RCVc?si=Apuspc_SFU12gBbD" target="_blank"&gt;https://youtu.be/vJo3BG2RCVc?si=Apuspc_SFU12gBbD&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If my response has helped you hit helpful button and if your concern is solved do mark my response as correct.&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; Regards&lt;BR /&gt;Viraj Hudlikar.&lt;/P&gt;</description>
      <pubDate>Fri, 28 Feb 2025 02:43:27 GMT</pubDate>
      <guid>https://www.servicenow.com/community/itsm-forum/how-to-write-a-quot-where-clause-quot-in-a-database-view/m-p/3191403#M536408</guid>
      <dc:creator>Viraj Hudlikar</dc:creator>
      <dc:date>2025-02-28T02:43:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to write a "where clause" in a database view</title>
      <link>https://www.servicenow.com/community/itsm-forum/how-to-write-a-quot-where-clause-quot-in-a-database-view/m-p/3194933#M536600</link>
      <description>&lt;P&gt;Hi ,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is not created by the client but OOB one, I just selected this as an example only!&lt;/P&gt;&lt;P&gt;why is order important in database view?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Vaishnavi&lt;/P&gt;</description>
      <pubDate>Tue, 04 Mar 2025 09:37:26 GMT</pubDate>
      <guid>https://www.servicenow.com/community/itsm-forum/how-to-write-a-quot-where-clause-quot-in-a-database-view/m-p/3194933#M536600</guid>
      <dc:creator>vishnumaaya</dc:creator>
      <dc:date>2025-03-04T09:37:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to write a "where clause" in a database view</title>
      <link>https://www.servicenow.com/community/itsm-forum/how-to-write-a-quot-where-clause-quot-in-a-database-view/m-p/3194935#M536601</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have multiple tables added,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;incident_metric, cmdb_ci_outage and u_business_unit (custom table which has markets details).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would want Incident number column, Outage number column, Duration(Outage) column and business unit column (where the outage has occurred) . How can I write database view for this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Vaishnavi&lt;/P&gt;</description>
      <pubDate>Tue, 04 Mar 2025 09:40:23 GMT</pubDate>
      <guid>https://www.servicenow.com/community/itsm-forum/how-to-write-a-quot-where-clause-quot-in-a-database-view/m-p/3194935#M536601</guid>
      <dc:creator>vishnumaaya</dc:creator>
      <dc:date>2025-03-04T09:40:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to write a "where clause" in a database view</title>
      <link>https://www.servicenow.com/community/itsm-forum/how-to-write-a-quot-where-clause-quot-in-a-database-view/m-p/3195293#M536619</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/828761"&gt;@vishnumaaya&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So on this case&amp;nbsp; you need to find out what is common in table and then create the where clause&amp;nbsp; to get the results, You can look OOTB database view to get an idea.&lt;/P&gt;</description>
      <pubDate>Tue, 04 Mar 2025 13:39:51 GMT</pubDate>
      <guid>https://www.servicenow.com/community/itsm-forum/how-to-write-a-quot-where-clause-quot-in-a-database-view/m-p/3195293#M536619</guid>
      <dc:creator>Dr Atul G- LNG</dc:creator>
      <dc:date>2025-03-04T13:39:51Z</dc:date>
    </item>
  </channel>
</rss>

