Answer the question
In order to leave comments, you need to log in
SQLAlchemy. How to select from a tree only those elements that have links in another table?
There are two tables, in one there is a tree of categories (table1) and subcategories, in the second there is useful data (table2)
The structure of the tables is something like this:
table1
`idn` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(255) DEFAULT NULL, # название
`parent` int(11) DEFAULT NULL, # id родителя
`idn` int(11) NOT NULL AUTO_INCREMENT,
`idcat` int(11) DEFAULT NULL, # id категории
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question