Home All Groups Group Topic Archive Search About

UPdating a table column with substring of another column

Author
20 Jul 2006 4:36 PM
mavrick_101
Hi,

I want to update a column based on substring  of another column (of the same
row and same table). How can I do that?

Thanx.

Author
20 Jul 2006 4:41 PM
Alejandro Mesa
Try,

update dbo.t1
set c1 = substring(c1, 5, 10)
where ...
go


AMB

Show quote
"mavrick_101" wrote:

> Hi,
>
> I want to update a column based on substring  of another column (of the same
> row and same table). How can I do that?
>
> Thanx.
Author
20 Jul 2006 5:14 PM
Arnie Rowland
It would help us better assist you if you could include table DDL, query
strategy used so far, sample data in the form of INSERT statements, and an
illustration of the desired results. ( For help with that refer to:
http://www.aspfaq.com/5006 )

Look up SUBSTRING in Books on Line.

--
Arnie Rowland
Most good judgment comes from experience.
Most experience comes from bad judgment.
- Anonymous


Show quote
"mavrick_101" <mavrick***@discussions.microsoft.com> wrote in message
news:3C223AD9-A123-43F4-BF52-A1001FF2CD63@microsoft.com...
> Hi,
>
> I want to update a column based on substring  of another column (of the
> same
> row and same table). How can I do that?
>
> Thanx.

AddThis Social Bookmark Button