I want to select a column and remove(replace with space) any line feeds or carriage returns and I want to get only the first 40 characters in the column after the replace.
Here is the query I tried but I get
select date, REPLACE(LEFT(message, '\r', ' '), 30) from table1 where message like 'testing%'
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ' ' '), 30) from events_cleared where message like 'testing%' ' at line 1
You have the ordering of your arguments incorrect (you have passed the
REPLACE arguments to
LEFT). Try this:
select date, REPLACE(LEFT(message, 30), '\r', ' ') from table1 where message like 'testing%'
- Why did my free disk space decrease after deleting some rows of a table on MySQL?
- Send Mail to different users where E-Mail-Adresses are from Mysql
- how to retrieve data using relationship in laravel
- Enable executing multiple statements while execution via sqlalchemy
- Calculating the Median with Mysql
- Unknown column when trying to add data to a database
- Gcloud error… glcloud crashed (BadStatusLine): ''
- Joining two foregin keys in the same table references the same primary key
- WPF Binding ValidationRules in one line?
- Why is removing the necessary “}” generates error, yet having it wrong renders page correctly[vue js]?
- Section 4.6.7, “mysqlbinlog — Utility for Process
- ", Schema Object Names mysql50 identifier prefix, Schema O
- s command: mysqld --verbose --help * To see
- backups produced by the `mysqlbackup` command of the MySQL E
- example: mysql> SELECT 1 + 1; ->
- ()` SQL function or the `mysql_insert_id()` C API function.
- he time zone tables with mysql_tzinfo_to_sql. `none()`¶
- ams, as displayed by the mysql client: mysql>
- haracters. mysql> SELECT ASCII('2');
- E_SUB()`: mysql> SELECT DATE_ADD('2018-05-01'