Good day. The following tables are available.
Leaf
+----+--------+ | id | name | +----+--------+ | 1 | first | +----+--------+ | 2 | second | +----+--------+ PLACE
+----+---------+------+ | id | list_id | summ | +----+---------+------+ | 1 | 1 | 100 | +----+---------+------+ | 2 | 1 | 200 | +----+---------+------+ I need to select all the fields from the LIST table so that the table has the name LIST and the sum PLACE . About the table should get this
+----+--------+------+ | id | name | summ | +----+--------+------+ | 1 | first | 300 | +----+--------+------+ | 2 | second | 0 | +----+--------+------+ I can’t imagine how to do this, because if you select a sample from PLACE , then those LIST that do not have PLACE will not get there. Otherwise, I have no idea how to summarize PLACE.summ