Like Command returning wrong result set

From: "Tchouante, Merlin" <mtchouan(at)umaryland(dot)edu>
To: "pgsql-sql(at)postgresql(dot)org" <pgsql-sql(at)postgresql(dot)org>
Subject: Like Command returning wrong result set
Date: 2021-08-05 14:00:38
Message-ID: CH0PR12MB5105EEAFE0AF3085B4F1095FD2F29@CH0PR12MB5105.namprd12.prod.outlook.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

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 '%'?

Thanks,
-- Merlin

Merlin D. Tchouante, Sr. IT Enterprise Application Developer
Center for Information Technology Services (CITS)
601 West Lombard Street
Baltimore, Maryland 21201-1512
mtchouan(at)umaryland(dot)edu<mailto:mtchouan(at)umaryland(dot)edu>
410-706-4489 * 410-706-1500 fax

Please send Blackboard questions to the CITS support email address: DL-CITSBbSupport(at)umaryland(dot)edu<mailto:dl-citsbbsupport(at)umaryland(dot)edu>
Please send Mediasite questions to the CITS support email address: DL-CITSMediasiteSupport(at)umaryland(dot)edu<mailto:DL-CITSMediasiteSupport(at)umaryland(dot)edu>

[New UMB Logo]

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Andreas Joseph Krogh 2021-08-05 14:04:24 Sv: Like Command returning wrong result set
Previous Message David G. Johnston 2021-08-03 16:22:19 Re: How to generate the order if you know the next item for each item?