{"id":194,"date":"2013-11-27T17:42:43","date_gmt":"2013-11-27T23:42:43","guid":{"rendered":"https:\/\/linux.asberry.org\/blog_tech\/?p=194"},"modified":"2024-05-14T09:15:05","modified_gmt":"2024-05-14T14:15:05","slug":"tcc-logical-or-filtering","status":"publish","type":"post","link":"https:\/\/asberry.org\/blog_tech\/?p=194","title":{"rendered":"TCC &#8211; Logical OR filtering"},"content":{"rendered":"<p>Writing SQL is kind of hard if your filtering is limited to and under the where clause. \u00a0Here&#8217;s an example of how to filter using OR, in this case we had 14 items:)<\/p>\n<pre class=\"brush: xml; light: false; title: ; toolbar: true; notranslate\" title=\"\">\r\n\r\n&lt;quer:filterings&gt;\r\n &lt;quer:filtering&gt;\r\n &lt;quer:or&gt;\r\n &lt;quer:or&gt;\r\n &lt;quer:or&gt;\r\n &lt;quer:or&gt;\r\n &lt;quer:or&gt;\r\n &lt;quer:or&gt;\r\n &lt;quer:or&gt;\r\n &lt;quer:or&gt;\r\n &lt;quer:or&gt;\r\n &lt;quer:or&gt;\r\n &lt;quer:or&gt;\r\n &lt;quer:or&gt;\r\n &lt;quer:or&gt;\r\n &lt;quer:containsIgnoreCase&gt;\r\n &lt;quer:field path=&quot;JobCode&quot;\/&gt;\r\n &lt;quer:string&gt;712187&lt;\/quer:string&gt;\r\n &lt;\/quer:containsIgnoreCase&gt;\r\n &lt;quer:containsIgnoreCase&gt;\r\n &lt;quer:field path=&quot;JobCode&quot;\/&gt;\r\n &lt;quer:string&gt;712188&lt;\/quer:string&gt;\r\n &lt;\/quer:containsIgnoreCase&gt;\r\n &lt;\/quer:or&gt;\r\n &lt;quer:containsIgnoreCase&gt;\r\n &lt;quer:field path=&quot;JobCode&quot;\/&gt;\r\n &lt;quer:string&gt;712186&lt;\/quer:string&gt;\r\n &lt;\/quer:containsIgnoreCase&gt;\r\n &lt;\/quer:or&gt;\r\n &lt;quer:containsIgnoreCase&gt;\r\n &lt;quer:field path=&quot;JobCode&quot;\/&gt;\r\n &lt;quer:string&gt;712865&lt;\/quer:string&gt;\r\n &lt;\/quer:containsIgnoreCase&gt;\r\n &lt;\/quer:or&gt;\r\n &lt;quer:containsIgnoreCase&gt;\r\n &lt;quer:field path=&quot;JobCode&quot;\/&gt;\r\n &lt;quer:string&gt;712183&lt;\/quer:string&gt;\r\n &lt;\/quer:containsIgnoreCase&gt;\r\n &lt;\/quer:or&gt;\r\n &lt;quer:containsIgnoreCase&gt;\r\n &lt;quer:field path=&quot;JobCode&quot;\/&gt;\r\n &lt;quer:string&gt;712386&lt;\/quer:string&gt;\r\n &lt;\/quer:containsIgnoreCase&gt;\r\n &lt;\/quer:or&gt;\r\n &lt;quer:containsIgnoreCase&gt;\r\n &lt;quer:field path=&quot;JobCode&quot;\/&gt;\r\n &lt;quer:string&gt;712063&lt;\/quer:string&gt;\r\n &lt;\/quer:containsIgnoreCase&gt;\r\n &lt;\/quer:or&gt;\r\n &lt;quer:containsIgnoreCase&gt;\r\n &lt;quer:field path=&quot;JobCode&quot;\/&gt;\r\n &lt;quer:string&gt;712063&lt;\/quer:string&gt;\r\n &lt;\/quer:containsIgnoreCase&gt;\r\n &lt;\/quer:or&gt;\r\n &lt;quer:containsIgnoreCase&gt;\r\n &lt;quer:field path=&quot;JobCode&quot;\/&gt;\r\n &lt;quer:string&gt;712084&lt;\/quer:string&gt;\r\n &lt;\/quer:containsIgnoreCase&gt;\r\n &lt;\/quer:or&gt;\r\n &lt;quer:containsIgnoreCase&gt;\r\n &lt;quer:field path=&quot;JobCode&quot;\/&gt;\r\n &lt;quer:string&gt;712089&lt;\/quer:string&gt;\r\n &lt;\/quer:containsIgnoreCase&gt;\r\n &lt;\/quer:or&gt;\r\n &lt;quer:containsIgnoreCase&gt;\r\n &lt;quer:field path=&quot;JobCode&quot;\/&gt;\r\n &lt;quer:string&gt;712185&lt;\/quer:string&gt;\r\n &lt;\/quer:containsIgnoreCase&gt;\r\n &lt;\/quer:or&gt;\r\n &lt;quer:containsIgnoreCase&gt;\r\n &lt;quer:field path=&quot;JobCode&quot;\/&gt;\r\n &lt;quer:string&gt;712604&lt;\/quer:string&gt;\r\n &lt;\/quer:containsIgnoreCase&gt;\r\n &lt;\/quer:or&gt;\r\n &lt;quer:containsIgnoreCase&gt;\r\n &lt;quer:field path=&quot;JobCode&quot;\/&gt;\r\n &lt;quer:string&gt;712657&lt;\/quer:string&gt;\r\n &lt;\/quer:containsIgnoreCase&gt;\r\n &lt;\/quer:or&gt;\r\n &lt;quer:containsIgnoreCase&gt;\r\n &lt;quer:field path=&quot;JobCode&quot;\/&gt;\r\n &lt;quer:string&gt;712839&lt;\/quer:string&gt;\r\n &lt;\/quer:containsIgnoreCase&gt;\r\n &lt;\/quer:or&gt;\r\n &lt;\/quer:filtering&gt;\r\n&lt;\/quer:filterings&gt;\r\n\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Writing SQL is kind of hard if your filtering is limited to and under the where clause. \u00a0Here&#8217;s an example of how to filter using OR, in this case we had 14 items:) &lt;quer:filterings&gt; &lt;quer:filtering&gt; &lt;quer:or&gt; &lt;quer:or&gt; &lt;quer:or&gt; &lt;quer:or&gt; &lt;quer:or&gt; &lt;quer:or&gt; &lt;quer:or&gt; &lt;quer:or&gt; &lt;quer:or&gt; &lt;quer:or&gt; &lt;quer:or&gt; &lt;quer:or&gt; &lt;quer:or&gt; &lt;quer:containsIgnoreCase&gt; &lt;quer:field path=&quot;JobCode&quot;\/&gt; &lt;quer:string&gt;712187&lt;\/quer:string&gt; &lt;\/quer:containsIgnoreCase&gt; &lt;quer:containsIgnoreCase&gt; &lt;quer:field [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_crdt_document":"","jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[13],"tags":[],"class_list":["post-194","post","type-post","status-publish","format-standard","hentry","category-tcc","author-aron"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p4bBkH-38","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/asberry.org\/blog_tech\/index.php?rest_route=\/wp\/v2\/posts\/194","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/asberry.org\/blog_tech\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/asberry.org\/blog_tech\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/asberry.org\/blog_tech\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/asberry.org\/blog_tech\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=194"}],"version-history":[{"count":4,"href":"https:\/\/asberry.org\/blog_tech\/index.php?rest_route=\/wp\/v2\/posts\/194\/revisions"}],"predecessor-version":[{"id":198,"href":"https:\/\/asberry.org\/blog_tech\/index.php?rest_route=\/wp\/v2\/posts\/194\/revisions\/198"}],"wp:attachment":[{"href":"https:\/\/asberry.org\/blog_tech\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=194"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/asberry.org\/blog_tech\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=194"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/asberry.org\/blog_tech\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=194"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}