开发者

Create Email List From SQL Developer Data

I want to export a list of email addresses ready to be copy and pasted into a distibution list for an email.

The select statemen开发者_如何学Got is simple:

select user_email from user_list where other = 'Y'

What do I need to do to add an ';' to the end of each email?

Im looking to product: joe.bloggs@email.com;janebloggs@email.com; ect


DECLARE @List varchar(max)

SET @List = ''

SELECT @List = @List + ';' + user_email FROM user_list WHERE other = 'Y'

SET @List = SUBSTRING(@List, 2, 2000000000)

SELECT @List


select user_email,';' from user_list where other = 'Y'
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜