0

There is an alphanumeric character '(123) 456-789 (sou_rav)' and output will be '123456789' (there should not be any special character) by using SQLite. SQLite version is 3.31.1

input output
(123) 456-789 (sou_rav) 123456789

I have tried below query but it's not working. Expecting out put is '123456789'

select replace(replace(replace('(123) 456-789 (sou_rav)', rtrim('(123) 456-789 (sou_rav)', '1234567890qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM!#$%^&*()_+-=`~[]\/{}|;:,.<>?'),''),'(',''),')','') as a from table_name;
  • SQLite doesn't have programmable functions or procedures. If you have a lot of rows, you could perhaps export to a database engine that has ? [example for SQL Server](https://stackoverflow.com/questions/18625548/select-query-to-remove-non-numeric-characters). Or, use a programming language to process the data in your SQLite. – MyICQ Jun 05 '23 at 22:15
  • It's usually easier to do any processing like that in the code that's handling the results of a sqlite query rather in the query itself. – Shawn Jun 05 '23 at 23:20

0 Answers0