62,271
社区成员
发帖
与我相关
我的任务
分享
select a.posts_id,a.posts_title,
(case ISNULL(b.reply_id,0) when 0 then a.posts_time else a.posts_time end ) newtime from Posts a
left join reply b on b.reply_id = a .posts_id
order by newtime desc
select a.posts_id,a.posts_title,(case ISNULL(b.reply_id,0) when 0 then a.posts_time else a.posts_time end ) newtime from Posts a
left join reply b on b.reply_id = a .posts_id
order by a.posts_id desc