Search Postgresql Archives

Re: select * from test where name like 'co_%'

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Mar 10, 2020 at 12:49:01PM +0000, sivapostgres@xxxxxxxxx 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





[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux