-1

SQL query

enter image description here

Output

enter image description here

What I need to be as output

enter image description here

Need out put as below:

"l22s '" => "l22s ."

If there are any HTML encoded strings , I need to decode them in select.

kalanamw
  • 5
  • 5
  • is this useful for you? https://stackoverflow.com/questions/3678980/is-there-a-mysql-function-to-decode-html-entities – sddk May 31 '21 at 12:42

1 Answers1

0

Try this, you need to extend WHEN POSITION(... IN locations.name) THEN REPLACE(locations.name, ..., ...) statements as much as you need.

SELECT REPLACE(locations.name, ''', '.')
FROM `locations`
SELECT 
CASE
  WHEN POSITION("'" IN locations.name) THEN REPLACE(locations.name, ''', '.')
  WHEN POSITION(<yourSecondItem> IN locations.name) THEN REPLACE(locations.name, <yourSecondItem>, <yourSecondReplaceItem>)
END AS `Name`
FROM `locations`
WHERE <yourWhereCriteria>
sddk
  • 1,115
  • 1
  • 10
  • 20