Trying to trim data in sqlite

I am trying to trim the data using trim, but still doesn't crop: it shows a new line and a space after each line.

Am I doing it wrong or is it impossible or do I need to use any other functions? Any help is greatly appreciated.

sqlite> select distinct trim(date_start) from test; 2011-03-22 08:00:00.0 2011-03-22 09:00:00.0 
+6
sqlite sqlite3
source share
1 answer

Are you sure the characters you are trying to crop are spaces? What you do should work:

 sqlite> create table test (date_start text); sqlite> insert into test values (' 2011-03-22 08:00:00.0'); sqlite> insert into test values (' 2011-03-22 09:00:00.0'); sqlite> select * from test; 2011-03-22 08:00:00.0 2011-03-22 09:00:00.0 sqlite> select distinct trim(date_start) from test; 2011-03-22 08:00:00.0 2011-03-22 09:00:00.0 
+4
source share

All Articles