I got two following tables
category:(one to many-----question)
id name parentId
1 test1 0
2 test2 1
3 test3 1
4 test4 3 .....
like a tree
test1
test2
test3
test4
question:
id title category_id
1 question1 1
2 .... 1
3 .... 2
my question is : if i search category id = 1 ,there will be print total questions:
count(question.id)
3
How to build Select query to do that? is that possible?
Thank you for your valuable help.