I want to count the same value among parent_id and id_article, but it can be 0 if there is no same value among parent_id and id_article
table:t_article
id_article parent_id
441 0
1093 18
18 0
3141 3130
3130 0
3140 3130
3142 3130
Expected output
id_article parent_id Total
441 0 0
1093 18 0
18 0 1
3141 3130 0
3130 0 3
3140 3130 0
3142 3130 0
How do I make it happen?