I'm trying to add HTML around a field I have in a MySQL table that has URLs in it. What I have right now is this
select
concat('<a href="', sourcelink,'">Link</a>') as sourcelink
from Table;
The first part of the concatination works for all the records, but only some of the records have the later part after the link. Have a look at this.

If I export the results to a spreadsheet, it becomes clear that the last part is there, but there's a line break.

I've tried TRIM() and REPLACE() to get rid of extra spaces and line breaks, but nothing seems to work. Apologies if I'm not explaining this well enough!