instead of using a join query for this, you would use a 2 recordsets,
the first recordset will return the categories
the second recordset nested inside the repeat region for the categories will return the items for the current category.
See the following tutorial for details:
http://www.webassist.com/community/tutorials/view_tutorial.php?tid=12