日期:2014-05-17 浏览次数:20498 次
insert into caogen(id,no,tittle,author,contents)
select * from (select top 158 * from _TangSi
where Author not in( select Author from huangjia)and Author<>'无名氏' order by NEWID() ) a
union
select * from _TangSi where Author='无名氏'
insert into caogen(id,no,tittle,author,contents)
select * from (select top 158 * from _TangSi
where Author not in( select Author from huangjia)and Author<>'无名氏' union
select * from _TangSi where Author='无名氏')as t order by NEWID()
with cte
as
(
select top 158 * from _TangSi
where Author not in( select Author from huangjia)and Author<>'无名氏' order by NEWID()
)
insert into caogen(id,no,tittle,author,contents)
select * from cte
union
select * from _TangSi where Author='无名氏'
select * from (select top 158 * from _TangSi
where Author not in( select Author from huangjia)and Author<>'无名氏' union
select * from _TangSi where Author='无名氏')as t order by NEWID()