日期:2014-05-17 浏览次数:20513 次
--测试1
declare @PageCount int,
@TopicId int,
@Num int
BEGIN
select
distinct
top 6
t.topicid,
t.title,
isnull(t.pic,'../images/pic003.jpg') as pic
from
dbo.T_Novel_Topic t,
dbo.T_Books_Order o
where
o.OrderType=2 and
o.UserId in (select UserId from dbo.T_Books_Order where BooksId=1) and
o.BooksId <> 1 and
-- o.BooksId not in (select Top (6*0) BooksId from dbo.T_Books_Order where UserId in(select UserId from dbo.T_Books_Order where BooksId=1)) and
o.BooksId=t.topicid and
o.Status=1
END
--测试2
select Top (6*1) BooksId from dbo.T_Books_Order where UserId in(select UserId from dbo.T_Books_Order where BooksId=1)
--测试3
select Top (6*2) BooksId from dbo.T_Books_Order where UserId in(select UserId from dbo.T_Books_Order where BooksId=1)