sql 2条数据(有n列数据不同.)需要求出不同列

[复制链接]
查看11 | 回复3 | 2012-1-18 17:30:03 | 显示全部楼层 |阅读模式
declare @str varchar(1000)set @str=''select @str=@str+cast(t as varchar)from (select case when count(distinct a)>1 then 'a,' else '' end as t from testunionselect case when count(distinct b)>1 then 'b,' else '' end from test union select case when count(distinct c)>1 then 'c,' else '' end from test unio...
回复

使用道具 举报

千问 | 2012-1-18 17:30:03 | 显示全部楼层
这个还真没有什么高招,只有按列比较。...
回复

使用道具 举报

千问 | 2012-1-18 17:30:03 | 显示全部楼层
fgh...
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行