There is a table of the form:
id title cat 1 название_1 категория_1 2 название_2 категория_2 3 название_3 категория_2 4 название_4 категория_4 5 название_5 категория_1 As a single query, you can display the entire list of categories from the cat field so that they do not repeat and look like this:
Категория_1 Категория_2 Категория_4
SELECT cat FROM table GROUP BY cat ORDER BY cat ASC- Vitaly Shebanits