I'm importing some restaurant information and have found that I'm missing the type of cuisine in the description field. How do I append a carriage return to a value?
This is what I have so far; I want the cuisine to go in on a new line:
select concat(field_id_20, '\r', 'french') from table
If you want a new line, then you're looking for a \n
newline rather than a carriage return.
SELECT CONCAT_WS('\n', field_id_20, 'french');
CONCAT_WS()
concatentates all subsequent arguments with the first argument. So you could add multiple lines this way by doing:
SELECT CONCAT_WS('\n', field_id_20, 'french', 'german', 'indian');
Outputs:
CurrentValueFrom field_id_20
french
german
indian
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With