Jump to content

aumbrother

New Members
  • Posts

    2
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

aumbrother's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Here is a tough one for you. Say, I have a table "categories" and a table "topics". Each category has thousands of topics in it. I want to write a join query that would display all categories with 10 top rated titles next to it. Here is what I have so far: [color=blue][b]SELECT[/b] c.title,t.title,[b]COUNT[/b](t.id) [b]AS[/b] topic_count [b]FROM[/b] category [b]AS[/b] c [b]LEFT JOIN ON[/b] t.category_id = c.id [b]GROUP BY[/b] c.id [b]ORDER BY[/b] topic_count [b]DESC[/b][/color] How do I modify this query so that it only gives me up to 10 topics per category? Thanks in advance
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.