摘要:
select distinct * into C_ColumnSchoolLive11 from C_ColumnSchoolLive drop table C_ColumnSchoolLive select * into C_ColumnSchoolLive from C_ColumnSchoolLive11 drop table C_ColumnSchoolLive11 阅读全文
摘要:
今天晚上写了个上下条新闻存储程序 declare @id int set @id=1 if exists(select * from tbl1 where id@id) select * from (select top 1 id,title from tbl1 where id@id order by id asc)t2 else if not exists(select * from tbl... 阅读全文
摘要:
select * from (select top 5 * from table1 order by time desc)t1 union select * from (select top 5 * from table2 order by time desc)t2 这样就可以先按table1的时间来排序,然后再到table2时间来排序 阅读全文