回复最新查询
create table article(aid int identity(1,1) primary key,
sid int not null,--类别ID
atitle varchar(100) not null,--文章标题
acontent text not null,--文章内容
mid int not null,--发布人ID
adate datetime not null,--发布时间
anum int not null,--浏览量
)
select a.* from article a join (select pid,adate=max(adate) from article where pid<>0 group by pid) b on (a.aid=b.pid) order by b.adate desc
这里没有回复的不能显示,谁能帮我改一下啊!