question

Qwety avatar image
Qwety asked

Need your help with a query

Hello,

Basically we have something called DOI for articles which are unique for each article. It looks like this 10.3311/euro.xx/xxx.yyyy

We have 2 slashes in the DOI, but i want to replace the 2nd slash with a dot(.) Using REPLACE query can we solve this problem? If yes, could you please send me an example query so that I can customize it for my application.

Thank You

mysql
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
malpashaa avatar image
malpashaa answered

SELECT STUFF(field, CHARINDEX('/', field, CHARINDEX('/', field) + 1), 1, '.') FROM (SELECT '10.3311/euro.xx/xxx.yyyy' AS field) AS T

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.