As far as I know you won't get sub-sub categories in an html select tag. You can however have one parent level of categories using the optgroup tag.
For example:
<select>
<optgroup label="Swedish Cars">
<option value="volvo">Volvo</option>
<option value="saab">Saab</option>
</optgroup>
<optgroup label="German Cars">
<option value="mercedes">Mercedes</option>
<option value="audi">Audi</option>
</optgroup>
</select>
Source: HTML optgroup tag
You could sort your table by group returning results as such:
item1 - header1
item2 - header1
item3 - header1
item1 - header2
item2 - header2
item3 - header2
Then while you're looping through your results if the header is different from the previous one, add a new optgroup tab. Look at the link I got the source from above and see if you can work it out. Or provide some code you already have and we might be able to have a look at it for you.