您的位置:首页 > 运维架构 > 网站架构

无法在线观看部分网站的视频(乐视网和搜狐网-----黑屏有声音)

2013-09-06 09:42 288 查看
<iframe align="center" marginwidth="0" marginheight="0" src="http://www.zealware.com/csdnblog336280.html" frameborder="0" width="336" scrolling="no" height="280"></iframe> 原帖地址:
http://community.csdn.net/Expert/topic/3452/3452577.xml?temp=.1377375

--示例数据
create table (A sysname,B varchar(10))
insert
select 'table_1','a'
union all select 'table_2','b'

create table table_1(A int)
insert table_1 select 1
union all select 2

create table table_2(A int)
insert table_2 select 3
union all select 4
go

/*--问题说明:

table中,A字段存储着其他表的名称
A字段中,记录和各个表的A字段的最大值
即得到如下结果:

table.B C
-------- -----------
a 1
b 2
--*/

--处理方法
declare @s varchar(8000)
set @s=''
select @s=@s+' when '''+A+''' then(select max(A) from ['+A+'])'
from
group by A
exec('select B,C=case A'+@s+' end from
')
go

--删除测试
drop table
,table_1,table_2

/*--测试结果

B C
---------- -----------
a 2
b 4
--*/
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: