simple UPDATE statement...

From: Joshua <joshua(at)joshuaneil(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: simple UPDATE statement...
Date: 2008-03-11 20:01:28
Message-ID: 47D6E518.5010405@joshuaneil.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hello,

I have a quick questions... consider the following information:

I have a table 'customers' which looks like the following:

firstname | middlename
-------------------|--------------------------
Johnathan C
Mark S
Joshua
Susan T
Jennifer
Marcus D
Mike G
Ted
William R

I would like to write a SQL update statement that yields the following
results:

firstname | middlename
-------------------|--------------------------
Johnathan C
Mark S
Joshua
Susan T
Jennifer
Marcus D
Mike G
Ted
William R

Basically, this... I need to take the middle initial from the
'firstname' field and place it in the 'middlename' field - that is if
only there is a middle initial in the 'firstname' field.

Please let me know the best way to write the UPDATE statement. If you
have any questions or need more info from me please feel free to email.

Thanks!!!

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Gauthier, Dave 2008-03-11 20:09:21 Array load from remote site through Perl/DBI
Previous Message Greg Smith 2008-03-11 19:32:15 Re: postgre vs MySQL