Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eOBCg-0000mG-H2 for pgsql-general@arkaria.postgresql.org; Sun, 10 Dec 2017 23:40:14 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eOBCf-0005T4-Ij for pgsql-general@arkaria.postgresql.org; Sun, 10 Dec 2017 23:40:13 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1eOBCf-0005Sr-8H for pgsql-general@lists.postgresql.org; Sun, 10 Dec 2017 23:40:13 +0000 Received: from mail-it0-x243.google.com ([2607:f8b0:4001:c0b::243]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1eOBCW-0003Cb-Up for pgsql-general@postgresql.org; Sun, 10 Dec 2017 23:40:12 +0000 Received: by mail-it0-x243.google.com with SMTP id x28so12018381ita.0 for ; Sun, 10 Dec 2017 15:40:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=2SjnijEOhrnHUCe3Vxa/lGcsTfe5FGPYgoIQqb8TMhU=; b=YjXNDlnsUw5BJItQE1nfdvqAoayWaQMUFCgc4l+n8aUizAwBOwG21/WmYGpu0gm601 i/bwnSnQQVwBHQH1I6sQu4cEBCPZmo6f2YnBB1nzsG1maybmdhK5/Lm+DLrKEbnMAnMh qnKWw52e7hCH9ToSV7K+YUPLoxQOeXYaizVzkDmM28/m0CjPh8648CmCGo69He9D64/m VdeOcljcRsD+87X6WHDvkbS+icEro03FkxZURoqkvjMe3Z6ZsI4xSJepF+pW2R65Jr2H nXTNE8lQ3LPbmW1mLNFBWLLvJS5n+z+8nYOngIiURdFieI8JnK6q/92M55Z8Ni4SNmcn ILkA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=2SjnijEOhrnHUCe3Vxa/lGcsTfe5FGPYgoIQqb8TMhU=; b=TrYWcxoD0GMiMDahiSakZNulPLgfOcTgZRI3HuYMaEi4wT5uje0P9reVFpeCxx7Mz2 ne2BfOTzgpBXBcXHhCH9MS74JK7IdckifVvvnLNzh05NXAiT7R0+3uWp9lOCOwl1idcJ Hf3ClLdegSl7Zc8M9kt+xDg4v6CTC31ClX1nr/yp8l626w8I4/LEu3Fmc4VAoqVudBjA 3bsulEu4DiRWN6oL9x9sFWDaD0LEWP4xWs+0QLlaKTSTW2I0UfL6ZVUAYPE00T7VLs7x gboZDIH2akv5b67m3xD1D0zBSr2ayo1sm5rXP/IsNX39zgXEQMCHNXU2dohuj/NjVUsA 7auQ== X-Gm-Message-State: AKGB3mLkP0GZdpO7TcuUDpfeiSACEC9O6R++gCEB8pd9og84vYW1FO+L kxkszh41+I24Zf4XhCBWNxo= X-Google-Smtp-Source: AGs4zMaPsyhjhw2yo7Q/P0IYumofFKZOm6eNK8vAYNYEWfFpUoIwChYBSL+YprMJieJgWC9F3Xv3vQ== X-Received: by 10.107.12.81 with SMTP id w78mr30442795ioi.148.1512949202105; Sun, 10 Dec 2017 15:40:02 -0800 (PST) Received: from ?IPv6:2601:681:5500:1e3c:3d08:febe:c93:fb27? ([2601:681:5500:1e3c:3d08:febe:c93:fb27]) by smtp.gmail.com with ESMTPSA id v203sm3110909itf.33.2017.12.10.15.40.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 10 Dec 2017 15:40:00 -0800 (PST) Content-Type: multipart/alternative; boundary=Apple-Mail-A5457CB1-8A4E-4319-A250-F979BA0EB0C6 Mime-Version: 1.0 (1.0) Subject: Re: Display table entries using partial column entry From: Gmail X-Mailer: iPad Mail (14G60) In-Reply-To: Date: Sun, 10 Dec 2017 16:39:59 -0700 Cc: Sherman Willden , "pgsql-general@postgresql.org" Content-Transfer-Encoding: 7bit Message-Id: <9C53B4B7-27AE-410B-B07A-002EF46DC480@gmail.com> References: To: Melvin Davidson List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --Apple-Mail-A5457CB1-8A4E-4319-A250-F979BA0EB0C6 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable > On Dec 10, 2017, at 4:10 PM, Melvin Davidson wrote:= >=20 >=20 >=20 >> On Sun, Dec 10, 2017 at 4:50 PM, Sherman Willden wrote: >> The database table has five columns; 'id aria artist a_artist album_title= '. I assume I will use a SELECT * FROM aria_precis WHERE type command. >>=20 >> I want to access all arias that have mio ben within the aria title. In th= e example below I want to display cbiylm06 and cbiylm10. >> =20 >> cbiylm06#Caro mio ben#Cecilia Bartoli##Se tu m'ami >> cbiylm07#Pur dicesti, o bocca bella#Cecilia Bartoli##Se tu m'ami >> cbiylm08#Intorno all'idol mio#Cecilia Bartoli##Se tu m'ami >> cbiylm09#Nel cor pi=C3=B9 non mi sento#Cecilia Bartoli##Se tu m'ami >> cbiylm10#Il mio ben quando ve#Cecilia Bartoli##Se tu m'ami=20 >> cbiylm11#O Leggiadri Occhi Belli#Cecilia Bartoli##Se tu m'ami >> cbiylm12#Il mio bel foco#Cecilia Bartoli##Se tu m'ami >>=20 >> Thank you; >>=20 >> Sherman >=20 > Sherman, > In the future, please be kind enough to provide PostgreSQL version and O/S= when posting to this listing. > Also include COLUMN HEADERS with all data and present the data formatted s= o it is easily readable by humans. >=20 > Presuming the # is your column divider, and the data you have provided loo= ks like this: > id #aria #artist = #a_artist #album_title > cbiylm06 #Caro mio ben #Cecilia Bartoli # = #Se tu m'ami > cbiylm07 #Pur dicesti, o bocca bella #Cecilia Bartoli # = #Se tu m'ami > cbiylm08 #Intorno all'idol mio #Cecilia Bartoli #= #Se tu m'ami > cbiylm09 #Nel cor pi=C3=B9 non mi sento #Cecilia Bartoli # = #Se tu m'ami > cbiylm10 #Il mio ben quando ve #Cecilia Bartoli # = #Se tu m'ami > cbiylm11 #O Leggiadri Occhi Belli #Cecilia Bartoli # = #Se tu m'ami > cbiylm12 #Il mio bel foco #Cecilia Bartoli = # #Se tu m'ami >=20 > Then all you really need is: > SELECT *=20 > FROM aria_precis=20 > WHERE aria LIKE '%mio ben%'; >=20 > Pattern Matching > https://www.postgresql.org/docs/9.6/static/functions-matching.html Where I hop you will find the tilde operator ('~', '~*'). Why more fun. >=20 > --=20 > Melvin Davidson > I reserve the right to fantasize. Whether or not you=20 > wish to share my fantasy is entirely up to you.=20 --Apple-Mail-A5457CB1-8A4E-4319-A250-F979BA0EB0C6 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable


On Dec 1= 0, 2017, at 4:10 PM, Melvin Davidson <melvin6925@gmail.com> wrote:



On Sun, Dec 10, 2017 at 4:50 PM, Sherman Willden <operasop= ranos@gmail.com> wrote:
The database table has five co= lumns; 'id aria artist=20 a_artist album_title'. I assume I will use a SELECT * FROM aria_precis=20 WHERE type command.

I want to access all arias that have=20 mio ben within the aria title. In the example below I want to display=20 cbiylm06 and cbiylm10.
 
cbiylm06#Caro mio ben#Cecilia Bartoli##S= e tu m'ami
cbiylm07#Pur dicesti, o bocca bella#Cecilia Bartoli##Se tu m'a= mi
cbiylm08#Intorno all'idol mio#Cecilia Bartoli##Se tu m'ami
cbiylm09= #Nel cor pi=C3=B9 non mi sento#Cecilia Bartoli##Se tu m'ami
cbiylm10#Il m= io ben quando ve#Cecilia Bartoli##Se tu m'ami
cbiylm11#O Leggiadri Occhi= Belli#Cecilia Bartoli##Se tu m'ami
cbiylm12#Il mio bel foco#Cecilia Bart= oli##Se tu m'ami

Thank you;

Sherman

Sherman,
In the future, please be k= ind enough to provide PostgreSQL version and O/S when posting to this listin= g.
Also include COLUMN HEADERS with all data and present the d= ata formatted so it is easily readable by humans.

Pr= esuming the # is your column divider, and the data you have provided looks l= ike this:
id            &nbs= p;   #aria            = ;               =           #artist   &= nbsp;            &nbs= p;      #a_artist     #album_titlecbiylm06    #Caro mio ben      &nb= sp;               #Ce= cilia Bartoli         #  &= nbsp;              #S= e tu m'ami
cbiylm07    #Pur dicesti, o bocca bella &n= bsp;  #Cecilia Bartoli         #&nbs= p;               = ; #Se tu m'ami
cbiylm08    #Intorno all'idol mio &nbs= p;             #Cecilia Ba= rtoli         #    &n= bsp;            #Se tu m'amicbiylm09    #Nel cor pi=C3=B9 non mi sento   =    #Cecilia Bartoli        #&nb= sp;              = ;  #Se tu m'ami
cbiylm10    #Il mio ben quando ve&nbs= p;          #Cecilia Bartoli &n= bsp;       #      &nb= sp;          #Se tu m'ami
cbiylm1= 1    #O Leggiadri Occhi Belli     &n= bsp;  #Cecilia Bartoli         #=               &n= bsp;  #Se tu m'ami
cbiylm12    #Il mio bel foco =               &n= bsp;      #Cecilia Bartoli    &= nbsp;    #          &= nbsp;      #Se tu m'ami

Then all you really need is:
SELECT *
   FROM aria_precis
WHERE ar= ia LIKE '%mio ben%';

Pattern Matching

Where I hop you will find the tilde ope= rator ('~', '~*').  Why more fun.

--
Melvin Davidson
I reserve the right to fantasize.  Whether or not you <= /span>
wish to share my fantasy is entirely up to you.

= --Apple-Mail-A5457CB1-8A4E-4319-A250-F979BA0EB0C6--