Table1
Name FruitA Mango
A Apple
A Grape
B. Mango
B. Mango
A. Mango
A. Apple
Output
Name. Mango Apple Grape
A. 2. 2. 1
B. 2. 0. 0
Can anyone write query to get this desired output from table one in Postgres please.
TIA