Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mBdz4-00041P-R3 for pgsql-sql@arkaria.postgresql.org; Thu, 05 Aug 2021 14:04:31 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mBdz3-0000Yx-NC for pgsql-sql@arkaria.postgresql.org; Thu, 05 Aug 2021 14:04:29 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mBdz3-0000Ym-BK for pgsql-sql@lists.postgresql.org; Thu, 05 Aug 2021 14:04:29 +0000 Received: from post.visena.com ([46.226.10.50]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mBdz0-00020g-Up for pgsql-sql@lists.postgresql.org; Thu, 05 Aug 2021 14:04:28 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=visena.com; s=20141101.wh; h=Content-Type:MIME-Version:Subject:References:In-Reply-To: Message-ID:To:From:Date:Sender:Reply-To:Cc:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=o/v5XPsm+F7cOy9OU2Wt7tSDcIjnRx7mc2yiowHuaPs=; b=PTN/gcHvA/J9WLEr/WzbH548lg yR51Fb3bsTiI43hlJ3Sb4r/TFpXRF9VZoTNr7ruAUbo/7Yk3GH6zd9mS8eoq1QxfCQJywgJiCTVgq YfJKfxXzu/Z7MvnMT/8S2CL5KgwvExpjcdQqrOBfHx/a2EWOoU4O7ogGfZzsa9l6xtTw=; Received: from tc7-visena.wh.internal.visena.com ([10.0.1.10]) by post.visena.com with esmtp (Exim 4.93) (envelope-from ) id 1mBdyy-007Cw7-Jw for pgsql-sql@lists.postgresql.org; Thu, 05 Aug 2021 16:04:24 +0200 Received: from localhost ([127.0.0.1] helo=tc7-visena.wh.internal.visena.com) by tc7-visena.wh.internal.visena.com with esmtp (Exim 4.90_1) (envelope-from ) id 1mBdyy-0003JD-GG for pgsql-sql@lists.postgresql.org; Thu, 05 Aug 2021 16:04:24 +0200 Date: Thu, 5 Aug 2021 16:04:24 +0200 (CEST) From: Andreas Joseph Krogh To: pgsql-sql@lists.postgresql.org Message-ID: In-Reply-To: References: Subject: Sv: Like Command returning wrong result set MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_1707_1666072410.1628172264345" X-Mailer: Visena Mail 2.2.689 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk ------=_Part_1707_1666072410.1628172264345 Content-Type: multipart/related; boundary="----=_Part_1708_1571688293.1628172264345" ------=_Part_1708_1571688293.1628172264345 Content-Type: multipart/alternative; boundary="----=_Part_1709_275515693.1628172264440" ------=_Part_1709_275515693.1628172264440 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable P=C3=A5 torsdag 05. august 2021 kl. 16:00:38, skrev Tchouante, Merlin < mtchouan@umaryland.edu >:=20 Hello group, I=E2=80=99m writing a script and a bit confused on the results with the lik= e 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/=20 CBCT. I was expecting it to return titles that contained *_CT, i.e. FX_CT or DR_C= T.=20 It=E2=80=99s as if it=E2=80=99s ignoring the underscore the way it would do= if you were using=20 =E2=80=98%CT=E2=80=99. Does it ignore the underscore when it=E2=80=99s righ= t after the =E2=80=98%=E2=80=99? * Percent sign ( %) matches any sequence of zero or more characters.=20 * Underscore sign ( _) matches any single character.=20 --=20 Andreas Joseph Krogh=20 ------=_Part_1709_275515693.1628172264440 Content-Type: text/html;charset=UTF-8 Content-Transfer-Encoding: quoted-printable
P=C3=A5 torsdag 05. august 2021 kl. 16:00:38, skrev Tchouante, Merlin = <mtchouan@umaryland.edu>= ;:

Hello group,

=C2=A0

I=E2=80=99m writing a = script and a bit confused on the results with the like command.<= /span>

=C2=A0

gm.title like 'CP_%'<= /span>

=C2=A0

The above command give= s me records with titles like CP_40, CP_2, CP_23, etc.

=C2=A0

gm.title like '%_CT'<= /span>

=C2=A0

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

=C2=A0

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

=C2=A0
    =09
  • Percent sign (=C2=A0%)=C2=A0matches any sequence = of zero or more characters.
  • =09
  • Underscore sign (=C2=A0_)=C2=A0 matches any singl= e character.
">
=C2=A0
--
Andrea= s Joseph Krogh
------=_Part_1709_275515693.1628172264440-- ------=_Part_1708_1571688293.1628172264345-- ------=_Part_1707_1666072410.1628172264345--