Sv: Like Command returning wrong result set - Mailing list pgsql-sql

From Andreas Joseph Krogh
Subject Sv: Like Command returning wrong result set
Date
Msg-id VisenaEmail.188.af6da13ea9c4fbc4.17b16a0cab8@tc7-visena
Whole thread Raw
In response to Like Command returning wrong result set  ("Tchouante, Merlin" <mtchouan@umaryland.edu>)
Responses Re: Like Command returning wrong result set
List pgsql-sql
På torsdag 05. august 2021 kl. 16:00:38, skrev Tchouante, Merlin <mtchouan@umaryland.edu>:

Hello group,

 

I’m writing a script and a bit confused on the results with the like command.

 

gm.title like 'CP_%'

 

The above command gives me records with titles like CP_40, CP_2, CP_23, etc.

 

gm.title like '%_CT'

 

The above command give me records with tiles like Quiz: RadiInterpretation w/ CBCT.

 

I was expecting it to return titles that contained *_CT, i.e. FX_CT or DR_CT.  It’s as if it’s ignoring the underscore the way it would do if you were using ‘%CT’.  Does it ignore the underscore when it’s right after the ‘%’?

 
  • Percent sign ( %) matches any sequence of zero or more characters.
  • Underscore sign ( _)  matches any single character.
 
--
Andreas Joseph Krogh

pgsql-sql by date:

Previous
From: "Tchouante, Merlin"
Date:
Subject: Like Command returning wrong result set
Next
From: Pavel Stehule
Date:
Subject: Re: Like Command returning wrong result set