Reputation: 3161
as title, I would to know how replace only the first char of a record if it contains a determinate char?
For example:
record: " hello" --> record "hello".
Here i remove the space from the string " hello"
Thanks
Upvotes: 1
Views: 5172
Reputation: 1213
If YourField has a space as first character, use this. You can, ofcourse, change the first character to whatever you like.
UPDATE YourTable SET
YourField = RIGHT(YourField,LENGTH(YourField)-1)
WHERE YourField like ' %'
Upvotes: 2
Reputation: 22721
You can't just update "only" the first character, you have to replace the whole column using a regular update.
Upvotes: 0