这个是不是这样可以,你试试:--drop table t1,t2
create table t1(name varchar(10))insert into t1
select '张三' union all
select '李四' union all
select '王五'create table t2(id int)insert into t2
select 1 union all
select 2 union all
select 3
go
select t2.id,t1.name
from
(
select Name,
ROW_NUMBER() over(order by getdate()) rownum
from t1
)t1
inner join
(
select id,
ROW_NUMBER() over(order by getdate()) rownum
from t2
)t2
on t1.rownum = t2.rownum
/*
id name
1 张三
2 李四
3 王五
*/
create table t1(name varchar(10))insert into t1
select '张三' union all
select '李四' union all
select '王五'create table t2(id int)insert into t2
select 1 union all
select 2 union all
select 3
go
select t2.id,t1.name
from
(
select Name,
ROW_NUMBER() over(order by getdate()) rownum
from t1
)t1
inner join
(
select id,
ROW_NUMBER() over(order by getdate()) rownum
from t2
)t2
on t1.rownum = t2.rownum
/*
id name
1 张三
2 李四
3 王五
*/
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货