This question already has answers here:
SQL SELECT from multiple tables
                                
                                    (7个答案)
                                
                        
                                5年前关闭。
            
                    
我有两个表hitsposts。在hits表中,我有id_post,hits,在posts表中,我有id,title

我需要使用所有具有相关命中数和命中顺序的帖子来构建报告。有人可以帮助我选择吗?

最佳答案

SELECT   posts.id as id, posts.title as title, hits.hits as hitsdate
FROM     posts INNER JOIN hits ON hits.id_post = posts.id
ORDER BY hits.hits

关于mysql - 用MySQL中的两个表选择,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/22224271/

10-12 14:22