另类十一之行,孤石刨土豆
: br> select
item.itemid,
min(truncate((unix_timestamp()-comments.dateline)/(24*60*60),0)+1) as time_margin,
count(comments.cid) as rateNum
from
discuz40.supe_userspaces bloger,
discuz40.supe_spaceitems item,
discuz40.supe_spacecomments comments,
discuz40.cdb_members mem ,gootrip.mdd_cat cat
where
1=1
and mem.uid=item.uid
and item.itemid=comments.itemid
and bloger.uid = item.uid
and mem.groupid in (1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25)
and item.catid in (107,108,109,115,116,117)
and item.itemid not in (30331,30289,30344,30379,30347,30273,30266,30241,30373,30346)
and item.type='blog'
and substring(item.destination, 1, instr(replace(replace(item.destination, '/', '#'), '|', '#'), '#')-1) = cat.catname
and comments.dateline >= unix_timestamp() - 24*60*60*7
and comments.dateline <= unix_timestamp() - 24*60*60*0.04
and comments.rates > 0
and comments.message = ''
and bloger.islock = 0
and item.folder = 1
and discuz40.space_ifhide(item.itemtypeid)=0
group by
item.itemid
order by
rateNum desc,
time_margin asc,
item.replynum desc,
item.dateline desc
limit
0,14
,the final sql is : br> select
item.itemid,
min(truncate((unix_timestamp()-comments.dateline)/(24*60*60),0)+1) as time_margin,
count(comments.cid) as rateNum
from
discuz40.supe_userspaces bloger,
discuz40.supe_spaceitems item,
discuz40.supe_spacecomments comments,
discuz40.cdb_members mem ,gootrip.mdd_cat cat
where
1=1
and mem.uid=item.uid
and item.itemid=comments.itemid
and bloger.uid = item.uid
and mem.groupid in (1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25)
and item.catid in (107,108,109,115,116,117)
and item.itemid not in (30331,30289,30344,30379,30347,30273,30266,30241,30373,30346)
and item.type='blog'
and substring(item.destination, 1, instr(replace(replace(item.destination, '/', '#'), '|', '#'), '#')-1) = cat.catname
and comments.dateline >= unix_timestamp() - 24*60*60*7
and comments.dateline <= unix_timestamp() - 24*60*60*0.04
and comments.rates > 0
and comments.message = ''
and bloger.islock = 0
and item.folder = 1
and discuz40.space_ifhide(item.itemtypeid)=0
group by
item.itemid
order by
rateNum desc,
time_margin asc,
item.replynum desc,
item.dateline desc
limit
0,14
: br> select
item.itemid as itemid,
item.subject as subject,
from_unixtime(item.dateline, '%m-%d %H:%i') as dateline,
from_unixtime(item.dateline, '%y-%m-%d %H:%i') as date_1,
from_unixtime(item.lastpost, '%y-%m-%d %H:%i') as lastpost,
item.dateline as alldate,
item.destination as destination,
item.replynum as replynum,
bloger.uid as uid,
bloger.spacename as username,
bloger.spacename as spacename,
bloger.photo as photo,
count(comments.cid) as rateNum,
left(blogs.message,4000) as message,
category.name as categoryName,
item.catid as catid,
item.type as type
from
discuz40.supe_spaceblogs blogs,
discuz40.supe_userspaces bloger,
discuz40.supe_categories category,
discuz40.supe_spaceitems item
left join
discuz40.supe_spacecomments comments
on item.itemid=comments.itemid
and comments.rates > 0
and comments.message = ''
and comments.dateline >= unix_timestamp() - 24*60*60*7
and comments.dateline <= unix_timestamp() - 24*60*60*0.04
where
1=1
and blogs.itemid=item.itemid
and bloger.uid = item.uid
and item.catid=category.catid
and item.itemid in (30291,30191,30295,30302,30287,30025,21808,30315,29936,30240,29407,29848,30316,30245)
and bloger.islock = 0
and item.folder = 1
and discuz40.space_ifhide(item.itemtypeid)=0
group by
item.itemid
union all
select
item.itemid as itemid,
item.subject as subject,
from_unixtime(item.dateline, '%m-%d %H:%i') as dateline,
from_unixtime(item.dateline, '%y-%m-%d %H:%i') as date_1,
from_unixtime(item.lastpost, '%y-%m-%d %H:%i') as lastpost,
item.dateline as alldate,
item.destination as destination,
item.replynum as replynum,
bloger.uid as uid,
bloger.spacename as username,
bloger.spacename as spacename,
bloger.photo as photo,
count(comments.cid) as rateNum,
left(images.message,2000) as message,
category.name as categoryName,
item.catid as catid,
item.type as type
from
discuz40.supe_spaceimages images,
discuz40.supe_userspaces bloger,
discuz40.supe_categories category,
discuz40.supe_spaceitems item
left join
discuz40.supe_spacecomments comments
on item.itemid=comments.itemid
and comments.rates > 0
and comments.message = ''
and comments.dateline >= unix_timestamp() - 24*60*60*7
and comments.dateline <= unix_timestamp() - 24*60*60*0.04
where
1=1
and images.itemid=item.itemid
and bloger.uid = item.uid
and item.catid=category.catid
and item.itemid in (30291,30191,30295,30302,30287,30025,21808,30315,29936,30240,29407,29848,30316,30245)
and bloger.islock = 0
and item.folder = 1
and discuz40.space_ifhide(item.itemtypeid)=0
group by
item.itemid
order by
rateNum desc,
alldate desc,
replynum desc
;
: br> select
item.itemid,
min(truncate((unix_timestamp()-comments.dateline)/(24*60*60),0)+1) as time_margin,
count(comments.cid) as rateNum
from
discuz40.supe_userspaces bloger,
discuz40.supe_spaceitems item,
discuz40.supe_spacecomments comments,
discuz40.cdb_members mem ,gootrip.mdd_cat cat
where
1=1
and mem.uid=item.uid
and item.itemid=comments.itemid
and bloger.uid = item.uid
and mem.groupid in (1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25)
and item.catid in (107,108,109,115,116,117)
and item.itemid not in (30331,30289,30344,30379,30347,30273,30266,30241,30373,30346,30291,30295,30191,30302,30287,30316,30315,30245,30240,30025,29936,29848,29407,21808)
and item.type='blog'
and substring(item.destination, 1, instr(replace(replace(item.destination, '/', '#'), '|', '#'), '#')-1) = cat.catname
and comments.dateline >= unix_timestamp() - 24*60*60*30
and comments.dateline <= unix_timestamp() - 24*60*60*0.04
and comments.rates > 0
and comments.message = ''
and bloger.islock = 0
and item.folder = 1
and discuz40.space_ifhide(item.itemtypeid)=0
group by
item.itemid
order by
rateNum desc,
time_margin asc,
item.replynum desc,
item.dateline desc
limit
0,10
,the final sql is : br> select
item.itemid,
min(truncate((unix_timestamp()-comments.dateline)/(24*60*60),0)+1) as time_margin,
count(comments.cid) as rateNum
from
discuz40.supe_userspaces bloger,
discuz40.supe_spaceitems item,
discuz40.supe_spacecomments comments,
discuz40.cdb_members mem ,gootrip.mdd_cat cat
where
1=1
and mem.uid=item.uid
and item.itemid=comments.itemid
and bloger.uid = item.uid
and mem.groupid in (1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25)
and item.catid in (107,108,109,115,116,117)
and item.itemid not in (30331,30289,30344,30379,30347,30273,30266,30241,30373,30346,30291,30295,30191,30302,30287,30316,30315,30245,30240,30025,29936,29848,29407,21808)
and item.type='blog'
and substring(item.destination, 1, instr(replace(replace(item.destination, '/', '#'), '|', '#'), '#')-1) = cat.catname
and comments.dateline >= unix_timestamp() - 24*60*60*30
and comments.dateline <= unix_timestamp() - 24*60*60*0.04
and comments.rates > 0
and comments.message = ''
and bloger.islock = 0
and item.folder = 1
and discuz40.space_ifhide(item.itemtypeid)=0
group by
item.itemid
order by
rateNum desc,
time_margin asc,
item.replynum desc,
item.dateline desc
limit
0,10
: br> select
item.itemid as itemid,
item.subject as subject,
from_unixtime(item.dateline, '%m-%d %H:%i') as dateline,
from_unixtime(item.dateline, '%y-%m-%d %H:%i') as date_1,
from_unixtime(item.lastpost, '%y-%m-%d %H:%i') as lastpost,
item.dateline as alldate,
item.destination as destination,
item.replynum as replynum,
bloger.uid as uid,
bloger.spacename as username,
bloger.spacename as spacename,
bloger.photo as photo,
count(comments.cid) as rateNum,
left(blogs.message,4000) as message,
category.name as categoryName,
item.catid as catid,
item.type as type
from
discuz40.supe_spaceblogs blogs,
discuz40.supe_userspaces bloger,
discuz40.supe_categories category,
discuz40.supe_spaceitems item
left join
discuz40.supe_spacecomments comments
on item.itemid=comments.itemid
and comments.rates > 0
and comments.message = ''
and comments.dateline >= unix_timestamp() - 24*60*60*30
and comments.dateline <= unix_timestamp() - 24*60*60*0.04
where
1=1
and blogs.itemid=item.itemid
and bloger.uid = item.uid
and item.catid=category.catid
and item.itemid in (29369,29825,29543,29980,29537,29803,29587,29339,29502,29252)
and bloger.islock = 0
and item.folder = 1
and discuz40.space_ifhide(item.itemtypeid)=0
group by
item.itemid
union all
select
item.itemid as itemid,
item.subject as subject,
from_unixtime(item.dateline, '%m-%d %H:%i') as dateline,
from_unixtime(item.dateline, '%y-%m-%d %H:%i') as date_1,
from_unixtime(item.lastpost, '%y-%m-%d %H:%i') as lastpost,
item.dateline as alldate,
item.destination as destination,
item.replynum as replynum,
bloger.uid as uid,
bloger.spacename as username,
bloger.spacename as spacename,
bloger.photo as photo,
count(comments.cid) as rateNum,
left(images.message,2000) as message,
category.name as categoryName,
item.catid as catid,
item.type as type
from
discuz40.supe_spaceimages images,
discuz40.supe_userspaces bloger,
discuz40.supe_categories category,
discuz40.supe_spaceitems item
left join
discuz40.supe_spacecomments comments
on item.itemid=comments.itemid
and comments.rates > 0
and comments.message = ''
and comments.dateline >= unix_timestamp() - 24*60*60*30
and comments.dateline <= unix_timestamp() - 24*60*60*0.04
where
1=1
and images.itemid=item.itemid
and bloger.uid = item.uid
and item.catid=category.catid
and item.itemid in (29369,29825,29543,29980,29537,29803,29587,29339,29502,29252)
and bloger.islock = 0
and item.folder = 1
and discuz40.space_ifhide(item.itemtypeid)=0
group by
item.itemid
order by
rateNum desc,
alldate desc,
replynum desc
;
月度玩家空间TOP10榜
: br> select
item.itemid,
min(truncate((unix_timestamp()-comments.dateline)/(24*60*60),0)+1) as time_margin,
count(comments.cid) as rateNum
from
discuz40.supe_userspaces bloger,
discuz40.supe_spaceitems item,
discuz40.supe_spacecomments comments,
discuz40.cdb_members mem ,gootrip.mdd_cat cat
where
1=1
and mem.uid=item.uid
and item.itemid=comments.itemid
and bloger.uid = item.uid
and mem.groupid in (1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25)
and item.catid in (107,108,109,115,116,117)
and item.itemid not in (30331,30289,30344,30379,30347,30273,30266,30241,30373,30346)
and item.type='blog'
and substring(item.destination, 1, instr(replace(replace(item.destination, '/', '#'), '|', '#'), '#')-1) = cat.catname
and comments.dateline >= unix_timestamp() - 24*60*60*7
and comments.dateline <= unix_timestamp() - 24*60*60*0.04
and comments.rates > 0
and comments.message = ''
and bloger.islock = 0
and item.folder = 1
and discuz40.space_ifhide(item.itemtypeid)=0
group by
item.itemid
order by
rateNum desc,
time_margin asc,
item.replynum desc,
item.dateline desc
limit
0,14
,the final sql is : br> select
item.itemid,
min(truncate((unix_timestamp()-comments.dateline)/(24*60*60),0)+1) as time_margin,
count(comments.cid) as rateNum
from
discuz40.supe_userspaces bloger,
discuz40.supe_spaceitems item,
discuz40.supe_spacecomments comments,
discuz40.cdb_members mem ,gootrip.mdd_cat cat
where
1=1
and mem.uid=item.uid
and item.itemid=comments.itemid
and bloger.uid = item.uid
and mem.groupid in (1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25)
and item.catid in (107,108,109,115,116,117)
and item.itemid not in (30331,30289,30344,30379,30347,30273,30266,30241,30373,30346)
and item.type='blog'
and substring(item.destination, 1, instr(replace(replace(item.destination, '/', '#'), '|', '#'), '#')-1) = cat.catname
and comments.dateline >= unix_timestamp() - 24*60*60*7
and comments.dateline <= unix_timestamp() - 24*60*60*0.04
and comments.rates > 0
and comments.message = ''
and bloger.islock = 0
and item.folder = 1
and discuz40.space_ifhide(item.itemtypeid)=0
group by
item.itemid
order by
rateNum desc,
time_margin asc,
item.replynum desc,
item.dateline desc
limit
0,14
: br> select
item.itemid as itemid,
item.subject as subject,
from_unixtime(item.dateline, '%m-%d %H:%i') as dateline,
from_unixtime(item.dateline, '%y-%m-%d %H:%i') as date_1,
from_unixtime(item.lastpost, '%y-%m-%d %H:%i') as lastpost,
item.dateline as alldate,
item.destination as destination,
item.replynum as replynum,
bloger.uid as uid,
bloger.spacename as username,
bloger.spacename as spacename,
bloger.photo as photo,
count(comments.cid) as rateNum,
left(blogs.message,4000) as message,
category.name as categoryName,
item.catid as catid,
item.type as type
from
discuz40.supe_spaceblogs blogs,
discuz40.supe_userspaces bloger,
discuz40.supe_categories category,
discuz40.supe_spaceitems item
left join
discuz40.supe_spacecomments comments
on item.itemid=comments.itemid
and comments.rates > 0
and comments.message = ''
and comments.dateline >= unix_timestamp() - 24*60*60*7
and comments.dateline <= unix_timestamp() - 24*60*60*0.04
where
1=1
and blogs.itemid=item.itemid
and bloger.uid = item.uid
and item.catid=category.catid
and item.itemid in (30291,30191,30295,30302,30287,30025,21808,30315,29936,30240,29407,29848,30316,30245)
and bloger.islock = 0
and item.folder = 1
and discuz40.space_ifhide(item.itemtypeid)=0
group by
item.itemid
union all
select
item.itemid as itemid,
item.subject as subject,
from_unixtime(item.dateline, '%m-%d %H:%i') as dateline,
from_unixtime(item.dateline, '%y-%m-%d %H:%i') as date_1,
from_unixtime(item.lastpost, '%y-%m-%d %H:%i') as lastpost,
item.dateline as alldate,
item.destination as destination,
item.replynum as replynum,
bloger.uid as uid,
bloger.spacename as username,
bloger.spacename as spacename,
bloger.photo as photo,
count(comments.cid) as rateNum,
left(images.message,2000) as message,
category.name as categoryName,
item.catid as catid,
item.type as type
from
discuz40.supe_spaceimages images,
discuz40.supe_userspaces bloger,
discuz40.supe_categories category,
discuz40.supe_spaceitems item
left join
discuz40.supe_spacecomments comments
on item.itemid=comments.itemid
and comments.rates > 0
and comments.message = ''
and comments.dateline >= unix_timestamp() - 24*60*60*7
and comments.dateline <= unix_timestamp() - 24*60*60*0.04
where
1=1
and images.itemid=item.itemid
and bloger.uid = item.uid
and item.catid=category.catid
and item.itemid in (30291,30191,30295,30302,30287,30025,21808,30315,29936,30240,29407,29848,30316,30245)
and bloger.islock = 0
and item.folder = 1
and discuz40.space_ifhide(item.itemtypeid)=0
group by
item.itemid
order by
rateNum desc,
alldate desc,
replynum desc
;