{"id":8233,"date":"2016-02-08T07:10:40","date_gmt":"2016-02-08T07:10:40","guid":{"rendered":"http:\/\/www.greytrix.com\/blogs\/sagex3\/?p=8233"},"modified":"2024-06-25T11:34:12","modified_gmt":"2024-06-25T11:34:12","slug":"alternate-to-like-keyword-of-sql","status":"publish","type":"post","link":"https:\/\/www.greytrix.com\/blogs\/sagex3\/2016\/02\/08\/alternate-to-like-keyword-of-sql\/","title":{"rendered":"Alternate to &#8220;like&#8221; Keyword of SQL"},"content":{"rendered":"<p>You may come across a situation, where you need alternate to the \u201clike\u201d keyword of SQL, that is to search for sub-strings in columns of the table.<\/p>\n<p>The one way to achieve it to use instr() function, instr() function takes 3 parameters in account.<\/p>\n<p>Syntax : instr( rank, string, sub_string )<\/p>\n<ol>\n<li><strong>Rank:<\/strong> Integer type expression giving the position corresponding to the 1st character in the string from which the sub-string search begins.<\/li>\n<li><strong>String:<\/strong> String is your text.<\/li>\n<li><strong>sub_string:<\/strong> The substring which you are looking for.<\/li>\n<\/ol>\n<p>The instr() returns 0 if it does not find the match.<\/p>\n<p>Now how to apply this to the table? As the instr() function is of x3 so its simple to apply.<\/p>\n<p><strong>Eg : <\/strong>Filter[ZCT] Where instr(1,ALLOTEDTO,&#8221;Ram&#8221;) &lt;&gt; 0.<\/p>\n<p>where 1 is the start position to look for sub-string, ALLOTEDTO is the column name which consists of the String and the last parameter is the sub-string itself. This will give you all records from the table where ALLOTEDTO column consists sub-string &#8220;Ram&#8221;<\/p>\n<p>which is equivalent to.<\/p>\n<p>Select * from ZCT where ALLOTEDTO like &#8216;%Ram%&#8217;.<\/p>\n<p><strong>Note:\u00a0<u> <\/u>\u00a0<\/strong>Instr() function is case-sensitive so always use the upper-case or lower-case function with it.<\/p>\n<p><strong><span style=\"font-size: Medium;\">About Us<\/span><\/strong><br \/>\n<a href=\"https:\/\/www.greytrix.com\/\">Greytrix<\/a> \u2013 a globally recognized Premier Sage Gold Development Partner is a one-stop solution provider for Sage ERP and Sage CRM needs. Being recognized and rewarded for multi-man years of experience, we bring complete end-to-end assistance for your technical consultations, product customizations, data migration, system integrations, third-party add-on development, and implementation expertise.<\/p>\n<p>Greytrix\u00a0caters to a wide range of Sage Enterprise Management (Sage X3) offerings \u2013 a Sage Business Cloud Solution. Our\u00a0unique GUMU&#x2122; integrations include\u00a0<a href=\"https:\/\/www.greytrix.com\/product\/sage-crm\/gumu-sage-x3-integration\">Sage Enterprise Management (Sage X3) for Sage CRM<\/a>,\u00a0<a href=\"https:\/\/www.greytrix.com\/product\/sage-x3\/gumu-x3-salesforce-integration\">Salesforce.com<\/a>,\u00a0and\u00a0<a href=\"https:\/\/www.greytrix.com\/product\/magento-sage-integrations\/sage-x3-magento\">Magento eCommerce<\/a>\u00a0along with Implementation and Technical Support worldwide for\u00a0<a href=\"https:\/\/www.greytrix.com\/africa\/product\/consulting\/implementation-planning\">Sage Enterprise Management (Sage X3)<\/a>. Currently, we are <a href=\"https:\/\/www.greytrix.com\/africa\">Sage Enterprise Management Implementation Partner<\/a> in East Africa, Middles East, Australia, and Asia.\u00a0We also offer best-in-class\u00a0<a href=\"https:\/\/www.greytrix.com\/product\/erp-development\/sage-x3\">Sage X3 customization and development services<\/a>,\u00a0integrated applications such as\u00a0<a href=\"https:\/\/www.greytrix.com\/product\/sage-enterprise-management-integration-services\/pos-system\">POS<\/a>\u00a0|\u00a0<a href=\"https:\/\/www.greytrix.com\/product\/sage-enterprise-management-integration-services\/warehouse-management-system\">WMS<\/a>\u00a0|\u00a0<a href=\"https:\/\/www.greytrix.com\/product\/sage-enterprise-management-integration-services\/payment-gateway\">Payment Gateway<\/a>\u00a0|\u00a0<a href=\"https:\/\/www.greytrix.com\/product\/sage-enterprise-management-integration-services\/shipping-system\">Shipping System<\/a>\u00a0|\u00a0<a href=\"https:\/\/www.greytrix.com\/product\/sage-enterprise-management-integration-services\/business-intelligence\">Business Intelligence<\/a>\u00a0|\u00a0<a href=\"https:\/\/www.greytrix.com\/product\/sage-x3\/ecommerce-magento-integration\">eCommerce<\/a>, and have developed add-ons such as Catch\u2013Weight and\u00a0Letter of Credit\u00a0for Sage Enterprise Management to Sage business partners, end users and Sage PSG worldwide.<\/p>\n<p>Greytrix is a recognized\u00a0<a href=\"https:\/\/www.greytrix.com\/blogs\/sagecrm\/2017\/07\/26\/greytrix-on-boards-sage-global-rockstar-isv-program-with-gumu-for-sage-crm-sage-x3-solution\/\">Sage Rockstar ISV Partner<\/a>\u00a0for GUMU&#x2122; Sage Enterprise Management \u2013 Sage CRM integration also listed on\u00a0<a href=\"https:\/\/www.sage.com\/marketplace\/asb_ListingDetail?listingId=a1h24000007PC3aAAG\" target=\"_blank\" rel=\"noopener\">Sage Marketplace<\/a>; GUMU&#x2122; integration for Sage Enterprise Management \u2013 Salesforce is a 5-star app listed on\u00a0<a href=\"https:\/\/appexchange.salesforce.com\/listingDetail?listingId=a0N30000000psM5EAI\" target=\"_blank\" rel=\"noopener\">Salesforce AppExchange<\/a>.<\/p>\n<p>For more information on Sage X3 Integration and Services, please contact us at\u00a0<a href=\"mailto:x3@greytrix.com\">x3@greytrix.com<\/a>. We will be glad to assist you.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>You may come across a situation, where you need alternate to the \u201clike\u201d keyword of SQL, that is to search for sub-strings in columns of the table. The one way to achieve it to use instr() function, instr() function takes 3 parameters in account. Syntax : instr( rank, string, sub_string ) Rank: Integer type expression\u2026 <span class=\"read-more\"><a href=\"https:\/\/www.greytrix.com\/blogs\/sagex3\/2016\/02\/08\/alternate-to-like-keyword-of-sql\/\">Read More &raquo;<\/a><\/span><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[118,1943,1947],"class_list":["post-8233","post","type-post","status-publish","format-standard","hentry","category-sage-erp-x3","tag-alternate-to-like-keyword-of-sql","tag-sage-x3-technical-blog","tag-sage-x3-technical-issues"],"_links":{"self":[{"href":"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-json\/wp\/v2\/posts\/8233","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-json\/wp\/v2\/comments?post=8233"}],"version-history":[{"count":7,"href":"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-json\/wp\/v2\/posts\/8233\/revisions"}],"predecessor-version":[{"id":29295,"href":"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-json\/wp\/v2\/posts\/8233\/revisions\/29295"}],"wp:attachment":[{"href":"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-json\/wp\/v2\/media?parent=8233"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-json\/wp\/v2\/categories?post=8233"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.greytrix.com\/blogs\/sagex3\/wp-json\/wp\/v2\/tags?post=8233"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}