Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- select post_id, count(post_id) from comments group by post_id order by count(post_id) desc limit 5;
- post_id | count
- ---------+-------
- 5 | 5
- 6 | 4
- 3 | 3
- 7 | 2
- 1 | 2
- (5 rows)
- select id,title from posts where id will be [5,6,3,7,1] with this order
- id | title
- ----+------------------------------------------------------------------
- 5 | Samsung 3G Chromebook Review
- 6 | The dd command on Linux terminal.
- 3 | Debian Mozilla team creates a Release archive for Iceweasel
- 7 | Seven Months of Bodhi Linux in Pictures
- 1 | New story! Cloud and On-premise Face Same Hacker Threats
- (5 rows)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement