Search Postgresql Archives

Re: SQL Question about like

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

 



On 8/10/20 11:37 AM, pgml@xxxxxx wrote:
Hello,

my SQL question is, why psql doesn't return the record?

create table lll (text char(100));
insert into lll (text) values ('10% - Ersthelfer');

select * from lll where text like '10% - Ersthelfer';

Other databases (Maria, SQL Server, YARD) do this.
What can I do in pg, to get the result?

Add a wildcard character.  (Also, why use LIKE in an equality?)

test=# select * from lll where text like '10% - Ersthelfer';
 text
------
(0 rows)

test=# select * from lll where text like '10% - Ersthelfer%';
                                                 text                                                
--------------------------------------------------------------
 10% - Ersthelfer                                                                                   
(1 row)

test=#
test=#
test=# select * from lll where text = '10% - Ersthelfer';
                                                 text                                                
--------------------------------------------------------------
 10% - Ersthelfer                                                                                   
(1 row)


--
Angular momentum makes the world go 'round.

[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