[mysql] sql query: combine two table
28 August 2007combine two tables, count specific values, order by the count, and show only top 10.
SELECT table1.comment_id comment_id, count(table1.comment_id) point, parent_id, subparent_id, text FROM table1 LEFT JOIN comments ON table1.comment_id=table2.comment_id WHERE board_id=1 GROUP BY table1.comment_id ORDER BY point DESC LIMIT 10
No comments yet


