From: Luuk <luuk34@gmail.com>
To: pgsql-general@lists.postgresql.org
Subject: Re: Display table entries using partial column entry
Date: Mon, 11 Dec 2017 10:55:35 +0100
Message-ID: <ec730212-cfd1-a303-46a8-6f167f03dd66@invalid.lan> (raw)
In-Reply-To: <xs4all.9C53B4B7-27AE-410B-B07A-002EF46DC480@gmail.com>
References: <xs4all.CAGv-wXEb+cGTR3wca0KWS9aSPrZQv5Fr2mT4eS9VjP5n32jwag@mail.gmail.com>
<xs4all.CANu8Fixr+Nnjpx7sHB_o12QgSpQN6xr0U3RHUAjLW2w2W0OhnQ@mail.gmail.com>
<xs4all.9C53B4B7-27AE-410B-B07A-002EF46DC480@gmail.com>
On 11-12-17 00:39, Gmail wrote:
>
>
> On Dec 10, 2017, at 4:10 PM, Melvin Davidson <melvin6925@gmail.com
> <mailto:melvin6925@gmail.com>> wrote:
>
>>
>>
>> On Sun, Dec 10, 2017 at 4:50 PM, Sherman Willden
>> <operasopranos@gmail.com <mailto:operasopranos@gmail.com>> wrote:
>>
...
>> Thank you;
>>
>> Sherman
>>
>>
>> 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 so it is easily readable by humans.
>>
>> Presuming the # is your column divider, and the data you have provided
>> looks 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ù 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
>>
>> Then all you really need is:
>> SELECT *
>> FROM aria_precis
>> WHERE aria LIKE '%mio ben%';
>>
>> 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.
You should be aware of case insensitivity.
LIKE '%mio ben%', will only match lower case
and, PostgreSQL-specific:
ILIKE '%mio ben%', will match any case
~ 'mio ben', will only match lower case
~* 'mio ben', will match any case
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: luuk34@gmail.com
Subject: Re: Display table entries using partial column entry
In-Reply-To: <ec730212-cfd1-a303-46a8-6f167f03dd66@invalid.lan>
References: <xs4all.CAGv-wXEb+cGTR3wca0KWS9aSPrZQv5Fr2mT4eS9VjP5n32jwag@mail.gmail.com> <xs4all.CANu8Fixr+Nnjpx7sHB_o12QgSpQN6xr0U3RHUAjLW2w2W0OhnQ@mail.gmail.com> <xs4all.9C53B4B7-27AE-410B-B07A-002EF46DC480@gmail.com> <ec730212-cfd1-a303-46a8-6f167f03dd66@invalid.lan>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox