Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 1 | This is an example of ' single, " double, and \ backslash (in the messed up records)
- 2 | This example is how it gets stored now backslash ' single " double
- 1 | This is an example of ' single, " double, and backslash
- 2 | This example is how it gets stored now backslash ' single " double
- 1 | This is an example of ' single, " double, and backslash (how data should be)
- DROP TABLE IF EXISTS tmpTable;
- CREATE TEMPORARY TABLE IF NOT EXISTS tmpTable ( BadText VARCHAR(100));
- INSERT INTO tmpTable
- SELECT 'This is an example of \' single, \"double, and \\ backslash';
- select BadText from tmpTable;
- update tmpTable
- set BadText = replace(replace(replace(BadText,'\'','''),'\"','"'),'\\','\');
- select BadText as GoodText from tmpTable;
- SELECT REGEX_REPLACE(your_column, '.*backslash{2,}.*', 'backslash') FROM table
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement