Can someone help point me in the right direction and maybe an example.

I need to populate a tree from data in sqlite. I would want it to read a column from sqlite and make items (but only distinct, aka different) entries, if there are duplicates, then skip over them, all the while keeping track of how many duplicates there are and adding it to the name of the item. Then under each item I want to list data from another column that match the first column.

Genres is the column to create the main item from, then GameTitles would be the individual items listed under it.

So it would look something like this when looking at it, not how it shows how many fall under a Genre after the Genre name
+ Action (2)
      Space Invaders
+ RPG (1)
+ Racing(3)
     GTA III
     GTA IV
     GTA V