OnbasiSoner
OnbasiSoner

Reputation: 53

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.

Upvotes: 0

Views: 63

Answers (1)

Matt
Matt

Reputation: 15061

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

Upvotes: 1

Related Questions