如何在sql server 2005中的特定员工的一列中显示所有列值 [英] how can i display all column values in one column of a particular employee in sql server 2005

查看:86
本文介绍了如何在sql server 2005中的特定员工的一列中显示所有列值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有这样的桌子

月员工部门销售价格产品
jan abcd Sales 200 adfds
2月300 dfsdfs
三月400 dfsdf
...
..
500年12月xyz

另外2名员工的记录也与上面类似

我想要类似
的输出
月员工部门销售价格产品
jan,feb..dec abcd sales 200,300,400 adfds,dfsdfs,dfsdf..xyz

hi i have table like this

months employees departments salesprice product
jan abcd Sales 200 adfds
feb 300 dfsdfs
march 400 dfsdf
...
..
december 500 xyz

and another 2 employees records also like above

i want output like

months employees deapartnment salesprice products
jan,feb..dec abcd sales 200,300,400 adfds,dfsdfs,dfsdf..xyz

推荐答案

在SQL Server中使用合并关键字

我认为该链接 [
USE coalesce keyword in SQL server

i think this link [^]will help you


这篇关于如何在sql server 2005中的特定员工的一列中显示所有列值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆