Re: UPDATE query

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

 



On Tue, Mar 8, 2011 at 11:16 AM, Ron Piggott
<ron.piggott@xxxxxxxxxxxxxxxxxx> wrote:
>
> I am wondering if there is a way to do an UPDATE query where only some of the text changes.
>
> The column I need to modify is named “toll_free”
> What I need to search for is: 800-
> I need it to replace it with is 1-800-
> - BUT I don’t want to change instances of 1-800-
> - I need to leave the rest of the toll free phone number in tact.
>

Another example::
-------------------------------------
update TABLE_NAME set FIELD_NAME = replace(FIELD_NAME, ‘find this
string’, ‘replace found string with this string’);

update client_table set company_name = replace(company_name, ‘Old
Company’, ‘New Company’)

The above statement will replace all instances of ‘Old Company’ to
‘New Company’ in the field of company_name of client_table table.

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux