Search Postgresql Archives

Re: Display table entries using partial column entry

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 11-12-17 00:39, Gmail wrote:
> 
> 
> On Dec 10, 2017, at 4:10 PM, Melvin Davidson <melvin6925@xxxxxxxxx
> <mailto:melvin6925@xxxxxxxxx>> wrote:
> 
>>
>>
>> On Sun, Dec 10, 2017 at 4:50 PM, Sherman Willden
>> <operasopranos@xxxxxxxxx <mailto:operasopranos@xxxxxxxxx>> 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





[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux