惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Simon Willison's Weblog
Simon Willison's Weblog
Help Net Security
Help Net Security
P
Privacy International News Feed
T
Threat Research - Cisco Blogs
C
Cisco Blogs
C
CERT Recently Published Vulnerability Notes
NISL@THU
NISL@THU
L
LINUX DO - 热门话题
Security Latest
Security Latest
A
Arctic Wolf
G
GRAHAM CLULEY
月光博客
月光博客
S
Securelist
D
Docker
J
Java Code Geeks
T
Troy Hunt's Blog
T
Tenable Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
SecWiki News
SecWiki News
S
Security @ Cisco Blogs
量子位
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
L
LINUX DO - 最新话题
Recent Commits to openclaw:main
Recent Commits to openclaw:main
aimingoo的专栏
aimingoo的专栏
博客园 - 【当耐特】
H
Heimdal Security Blog
The Hacker News
The Hacker News
博客园 - 三生石上(FineUI控件)
Application and Cybersecurity Blog
Application and Cybersecurity Blog
N
Netflix TechBlog - Medium
Vercel News
Vercel News
Forbes - Security
Forbes - Security
B
Blog RSS Feed
H
Hackread – Cybersecurity News, Data Breaches, AI and More
IT之家
IT之家
B
Blog
MongoDB | Blog
MongoDB | Blog
博客园 - 聂微东
Google DeepMind News
Google DeepMind News
S
Secure Thoughts
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
C
Check Point Blog
云风的 BLOG
云风的 BLOG
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
T
The Blog of Author Tim Ferriss
L
Lohrmann on Cybersecurity
F
Full Disclosure
D
Darknet – Hacking Tools, Hacker News & Cyber Security
P
Proofpoint News Feed

博客园 - seamanhy

Android Studio 安装说明 Google——Tracking Code, Map Api ASP.NET输出到Excel - seamanhy - 博客园 GridView中BoundField重复绑定数据 一个等待的小功能 MS SQL 区分大小写 盗链 防止盗链 防止图片盗链 HTML编辑器 免费编辑器 中文免费HTML编辑器 URLReWriter ASP.NET 页面跳转 伪静态页面 多参数 VBSCRIPT控制网页打印页眉和页脚 - seamanhy - 博客园 一个免费的天气预报WebService 常用正则表达式 - seamanhy - 博客园 推荐一个SQL分页函数 一些网站中经常使用的插件 PNG24在IE6中不正常显示的问题 DataSet导入到Excel文件 Google拼音输入法字库分析程序 查看SQL Server 2000执行时间 SQL Server将字符串转换为多行
SQL Server将数据库中多行中的某个字段转换为字符串
seamanhy · 2007-07-27 · via 博客园 - seamanhy
   

将表名为TableName字段为Name的字段的值拼接起来,返回结果name1,name2,name...

CREATE FUNCTION convertMultiRowsToChar(@id intRETURNS varchar(50
AS BEGIN DECLARE @sql varchar(50)
SET @sql = ''
          
SELECT @sql = @sql + ',' + cast(Name AS varchar)
        
FROM TableName
        
WHERE Id = @id RETURN stuff(@sql11''END