say i have a table named Trees and other table named Fruits and i wanna count the number of fruit object which haves the objectId of a tree object (tree (from table TREES ) is related to FRUITS Table (ONE TO MANY RELATION) )
example
table TREES
id - 1
tree - maple
id - 2
tree - orange
id- 3
tree - mango
table FRUITS
id - 001
treeID - 1
name - bla bla
id - 002
treeID - 1
name - bla bla
id - 003
treeID - 1
name - bla bla
id - 004
treeID - 2
name - bla bla
id - 005
treeID - 3
name - bla bla
so how can i get the number of related objects of TREE table From FRUITS table which is here : tree 1 haves 3 objects in FRUITS table