Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.92) (envelope-from ) id 1jBeP4-0002Q7-Mg for pgsql-general@arkaria.postgresql.org; Tue, 10 Mar 2020 12:54:34 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1jBeP2-0007Cq-QQ for pgsql-general@arkaria.postgresql.org; Tue, 10 Mar 2020 12:54:32 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1jBeP2-0007Ce-D3 for pgsql-general@lists.postgresql.org; Tue, 10 Mar 2020 12:54:32 +0000 Received: from aart.rice.edu ([168.7.56.48]) by makus.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jBeOz-0007vO-I5 for pgsql-general@lists.postgresql.org; Tue, 10 Mar 2020 12:54:30 +0000 Received: by aart.rice.edu (Postfix, from userid 18612) id E5EC9427F2F8; Tue, 10 Mar 2020 07:54:28 -0500 (CDT) Date: Tue, 10 Mar 2020 07:54:28 -0500 From: Kenneth Marshall To: "sivapostgres@yahoo.com" Cc: Postgresql General Group Subject: Re: select * from test where name like 'co_%' Message-ID: <20200310125428.GV32117@aart.rice.edu> References: <1482349013.1084585.1583844541651.ref@mail.yahoo.com> <1482349013.1084585.1583844541651@mail.yahoo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1482349013.1084585.1583844541651@mail.yahoo.com> User-Agent: Mutt/1.5.21 (2010-09-15) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Tue, Mar 10, 2020 at 12:49:01PM +0000, sivapostgres@yahoo.com wrote: > Hello, > What returns when I run a query like this; > Select * from test where name like 'co_%'; > I expect anything that starts with 'co_' and NOT 'co' only.  Am I right?  But I get every names that starts with 'co'. Why ? > Happiness Always > BKR Sivaprakash Hi, Check out the documentation: https://www.postgresql.org/docs/12/functions-matching.html#FUNCTIONS-LIKE You have 2 meta characters there. The '_' matches any character also. Regards, Ken