pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Rob Kirkbride <rob@rkcomputing.co.uk>
To: ij@perlpimp.dk
Cc: pgsql-sql@postgresql.org
Subject: Re: 'select where' using multiple columns.
Date: Fri, 05 Aug 2005 11:49:18 +0100
Message-ID: <42F3442E.9030906@rkcomputing.co.uk> (raw)
In-Reply-To: <42F33E53.3000002@perlpimp.dk>
References: <42F33585.1090706@rkcomputing.co.uk>
	<42F33E53.3000002@perlpimp.dk>

Ian Johannesen wrote:

>Hi.
>
>Rob Kirkbride wrote:
>  
>
>>I've got a persons name which is being stored say in 3 columns :- 
>>Title, Forename_1, Forename_2, Surname. I want to allow a search say for
>>'John Smith'. Problem is I can't just break it up into forename and
>>surname because I won't also know.
>>Is there a way to do something like a
>>'select * where forename_1,forename_2,surname like '%String%'   ??
>>
>>    
>>
>SELECT * FROM table WHERE forename_1 || ' ' || forename_2 || ' ' ||
>surname LIKE '%String%';
>
>  
>
Thanks for the quick response. I've tried that and it works fine. Thanks 
a lot and thanks to Daq and Helder.

Rob



view thread (5+ messages)

Message-ID: <42F3442E.9030906@rkcomputing.co.uk>
Permalink:  ../42F3442E.9030906@rkcomputing.co.uk/
Also on:    postgresql.org/message-id/42F3442E.9030906@rkcomputing.co.uk

 · 

reply

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 using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: rob@rkcomputing.co.uk, ij@perlpimp.dk
  Subject: Re: 'select where' using multiple columns.
  In-Reply-To: <42F3442E.9030906@rkcomputing.co.uk>

* 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