1.三个文章详情表 加上一个用户表,找出最近时间发布的一篇文章并显示其详情
2.现在我的做法是
select (SELECT time from g_answer where uid=m.id and a_status=1 order by time limit 1) answer,(SELECT time from g_enjoy where uid=m.id and e_status=1 order by time limit 1) enjoy,(select time from g_art_detail where user_number=m.id and status
=1 ORDER BY time LIMIT 1) article from g_member m where id=13975;
3.然后进行时间排序,返回键名,然后根据具体表再次查询具体信息。
总感觉麻烦,有没有优化的方式?
建议在向三个文章表插入数据时,新建一张表(id,article_table,art_id) 专门存储这三个表中最新的那条记录,然后查的时候就方便多了