Sql Replace function It Replaces all occurrences of a specified string value with another string value.
Query:
Select ProductId, ProductName, Replace(ProductName, 'Chef', 'C') ReplProductName, QuantityPerUnit From Products Order By ProductName
The above query is from Northwind Database and ProductName is the column of Products table. And I have replaced Chef with 'C'.
Result:
| ProductId | ProductName | ReplacedProductName | Quantity |
4 | Chef Anton's Cajun Seasoning | C Anton's Cajun Seasoning | 48 - 6 oz jars |
| 5 | Chef Anton's Gumbo Mix | C Anton's Gumbo Mix | 36 boxes |
|
No responses found. Be the first to respond and make money from revenue sharing program.
|