0

I have some data that stored as two lines: Example is the address:

100 Blvd apt 100 ==> this is how it reads in the database. when I copy and paste the address then it is in two lines:

100 Blvd
Apt 100

How to update this record to be one line only.

Any help appreciated. thanks!

Alex K.
  • 171,639
  • 30
  • 264
  • 288
user7675421
  • 67
  • 1
  • 14

1 Answers1

1

I'm assuming there's a line break in your string. So either remove them all, or use a SQL query to strip out line breaks.

e.g

SELECT REPLACE(REPLACE(COLUMN_NAME_GOES_HERE, CHAR(13), ''), CHAR(10), '')

Or, if you want to replace newlines with a space:

SELECT REPLACE(REPLACE(COLUMN_NAME_GOES_HERE, CHAR(13), ''), CHAR(10), ' ')
JeffUK
  • 4,107
  • 2
  • 20
  • 34
  • 1
    Last `''` needs to be `' '` else you will munge everything together – Alex K. May 12 '17 at 14:22
  • Correct in this instance, yes, although sometimes 'munging everything together' is the desired outcome. Edited for posterity – JeffUK May 15 '17 at 12:38