OnbasiSoner OnbasiSoner - 6 months ago 11
SQL Question

String regex on sql

I have

"X1lNtWp4_e"
type of string on SQL code.

I wanna convert like
X1lNtWp4_e
without the
( " )
.

My DB Engine codes like MySQL I think.

I'm using http://chartio.com so i'm not sure which db engine.

Answer

Chartio is just a front end but assuming your DB is MySQL simply use:

Use the TRIM function with the BOTH argument:

SELECT TRIM(BOTH '"' FROM '"X1lNtWp4_e"')
FROM yourtable

Use the REPLACE function if the middle content contains " also and you want them removed:

SELECT REPLACE('"X1lNtWp4_e"', '"', '')
FROM yourtable