Re: How to merge several attributes and Delete an attribute

From: "Annie Bai" <annie_job(at)hotmail(dot)com>
To: vladimirt(at)rila(dot)bg
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: How to merge several attributes and Delete an attribute
Date: 2002-01-31 19:33:36
Message-ID: F187qsh1lBLMasiZAPG0000a858@hotmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Well, I am not familiar with functions, Do they have better performance than
the plain query as the following?

select * from table where Firstname like 'blah' or middlename like
'blah'....

Thank you
Annie

>From: Vladimir Terziev <vladimirt(at)rila(dot)bg>
>To: "Yan Bai" <annie_job(at)hotmail(dot)com>
>Subject: Re: [SQL] How to merge several attributes and Delete an attribute
>Date: Thu, 31 Jan 2002 10:21:31 +0200
>
> Hi,
> I sugest you to use 'textcat' function. Something like this:
> select textcat(textcat(textcat(textcat($1, " "), $2), " "), $3)
> ' language 'SQL';
>
> select * from your_table where textcat(textcat(textcat(textcat(FirstName,
>' '), MiddleName), ' '), LastName) like '%somename%';
>
> Good luck!
>
> Vladimir
>
>
>On Thu, 31 Jan 2002 07:34:40 +0000
>"Yan Bai" <annie_job(at)hotmail(dot)com> wrote:
>
> > Hello all,
> >
> > My initial table has 3 attributes: FirstName, MiddleName and LastName.
>Now I
> > want to merge them into one, then I could make a search action using
>LIKE
> > more easily.
> > what should i do for that?
> >
> > Also, I want to know how to delete one attribute from a table.
> >
> > Thanks a lot,
> >
> > Annie
> >
> > _________________________________________________________________
> > MSN Photos is the easiest way to share and print your photos:
> > http://photos.msn.com/support/worldwide.aspx
> >
> >
> > ---------------------------(end of broadcast)---------------------------
> > TIP 3: if posting/reading through Usenet, please send an appropriate
> > subscribe-nomail command to majordomo(at)postgresql(dot)org so that your
> > message can get through to the mailing list cleanly

_________________________________________________________________
Join the worlds largest e-mail service with MSN Hotmail.
http://www.hotmail.com

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Josh Berkus 2002-01-31 20:35:39 Re: How to merge several attributes and Delete an
Previous Message Tom Lane 2002-01-31 16:57:44 Re: working with sequences