Re: Wildcard with Update
- From: Hugo Kornelis <hugo@xxxxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 01 Jun 2005 22:37:34 +0200
On Wed, 1 Jun 2005 12:47:21 -0700, Donn wrote:
>SQL 7.0
>Need to replace all
> AB 2005-XXX
>with
> C 2005-YYY
>Thinking about the following...but, the '%' is taken as a literal in 'C%-YYY'.
>update table
>set f1 = 'C%-YYY'
>where f1 like 'AB%-XXX'
>Thanks,
>Don
Hi Don,
Try if this works:
UPDATE MyTable
SET F1 = STUFF(F1, 1, 2, 'C')
WHERE F1 LIKE 'AB%-XXX'
Best, Hugo
--
(Remove _NO_ and _SPAM_ to get my e-mail address)
.
- References:
- Wildcard with Update
- From: Donn
- Wildcard with Update
- Prev by Date: Re: Rename a primary key column
- Next by Date: Re: Rename a primary key column
- Previous by thread: Wildcard with Update
- Index(es):