开发者

How to replace row value in SQL Server?

My table contains some rows like below

  1. Lcd - projector
  2. A &开发者_Python百科amp; A products
  3. saranvana store
  4. LG - television
  5. IFB - fridge
  6. samsung - Monitor

I want to replace space (special char) instead of - (hyphens) in all records


UPDATE Table
SET MyColumn = REPLACE(MyColumn, ' - ', ' ')


I'm not 100% sure what you want but to remove the hyphen you can do this:

Update dbo.MyTable
Set myCol = Replace(myCol, '-', space(0))

Or as a select statement

Select Replace(myCol, '-', space(0))
From dbo.MyTable
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜