I have a query that pulls different data but for one field it concats its since the URL is partially filled in my db
select blah, blah2, blah3, concat('https://my_url.com', g.logourl ) as logourl
but the problem is if logourl is blank then I just get https://my_url.com instead of the full URL. This is having down stream impact.
Is there a way to only concat if logurl is not null?
Advertisement
Answer
You can try using case when
expression
select blah, blah2, blah3, case when g.logourl is not null and g.logourl<>'' then concat('https://my_url.com', g.logourl ) end as logourl