I think I need to understand your problem first and what determines "unique".
You say you want a list of titles but your example ideal result looks like a list of categories.
I also probably need to know the cardinalities between id, title and hash fields e.g. how many titles per hash or ids per title etc