Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eOLBZ-0002ej-GF for pgsql-general@arkaria.postgresql.org; Mon, 11 Dec 2017 10:19:45 +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 1eOLBZ-0003Bg-0Y for pgsql-general@arkaria.postgresql.org; Mon, 11 Dec 2017 10:19:45 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1eOKoG-0006Za-Bo for pgsql-general@lists.postgresql.org; Mon, 11 Dec 2017 09:55:40 +0000 Received: from mail-wm0-x22c.google.com ([2a00:1450:400c:c09::22c]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1eOKoD-0000NZ-JN for pgsql-general@lists.postgresql.org; Mon, 11 Dec 2017 09:55:39 +0000 Received: by mail-wm0-x22c.google.com with SMTP id g75so13300186wme.0 for ; Mon, 11 Dec 2017 01:55:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:subject:to:newsgroups:references:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=PEs/uXVbFXRnmSHoHfuyj53pWSnmChFjM6/JbXErmDc=; b=uQqQbpEfOD+AnosSbGd7uEe+9y8sWttCOdwVkgryiZvyksspTsg6QQrMB+YQ+pm+Rn vBUs4TAt9aj0pOvzAXMMZRGtYP015VIJtYOw/SnLotFN/g4mBMKwzWWoRMoXj36PwqOd deNveadv3vCjPNnmN9hpXBRonc2W6JwqMjL+ky2A2tiVLR4lNNcyrWGSQXH4lylt3kpT vNcjWVwG/6FDC91+z0yphLwpQV5wig7ugy1xKBxsc65K0mB2sfgn0SXkon3rw6hc4LII i/r4jhUerSXa7/xZxMl5kmVAGvaiBwJXc0F1LT4os4wXYsxggB+7qgRIzFrdSJLVeQs7 mPVg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:subject:to:newsgroups:references:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=PEs/uXVbFXRnmSHoHfuyj53pWSnmChFjM6/JbXErmDc=; b=gm+pM0Hypkpw63ckjAOlNu51AiKUeaDYo/uZ0Hew8n4nak3xGrVtfVZfDg9aSST9Y7 kpdrldelX1MEQUpXSZ3Gn80GvueVOZCJS/VytCRgd0Dj9yTwuy0swQ7kruZ5PL6+wosm JP+4JzfXsPRer3rqRPRUm5Q2NriTBGoj/Y9mKeDfIi5uX6KRUBAURfA3Q4uOsiBrH5jg 6xwGRiXo+uRxYbC0eb4gXn3FAtBk1o7TOZANBZuUhNHzIM98574fOoZaOgSjm2Ge8xo2 0Nvgri8ZB7X5I6L4WhlQ98QHLArc8fn/gvXN2oejqyCF7OcB7whL6kLN07wKE/W8jFOf Idmw== X-Gm-Message-State: AKGB3mLY+11wYHuFqrZAVrNbyizZ/Luz5F3t70sIBfeqpPtnQkjrRFyn I8oWab+xo95px1fv4FP2HO0cRf5f X-Google-Smtp-Source: ACJfBos8ZFsJQX7JKN4NrhITkmW235zIXeKtFlYdNN5lQF+AGB81kWT4KS7aegIYP0mLK5znKi3JjQ== X-Received: by 10.80.146.77 with SMTP id j13mr321929eda.298.1512986134810; Mon, 11 Dec 2017 01:55:34 -0800 (PST) Received: from ?IPv6:2001:980:9089:1:758a:a7c5:a9eb:e113? ([2001:980:9089:1:758a:a7c5:a9eb:e113]) by smtp.gmail.com with ESMTPSA id e49sm6771284eda.90.2017.12.11.01.55.33 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 Dec 2017 01:55:33 -0800 (PST) From: Luuk X-Google-Original-From: Luuk Subject: Re: Display table entries using partial column entry To: pgsql-general@lists.postgresql.org Newsgroups: lists.pgsql.general References: Message-ID: Date: Mon, 11 Dec 2017 10:55:35 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 11-12-17 00:39, Gmail wrote: > > > On Dec 10, 2017, at 4:10 PM, Melvin Davidson > wrote: > >> >> >> On Sun, Dec 10, 2017 at 4:50 PM, Sherman Willden >> > 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