I am trying to count the number of times that name in NAME appear in BOSS_PATH.
The source
NAME BOSS_PATH
---------------------
WIN WIN
JOHN WIN|JOHN
DANG WIN|JOHN|DANG
JOSH JOSH
The result I want
NAME BOSS_PATH COUNT_UNDER
--------------------------------------
WIN WIN 2
JOHN WIN|JOHN 1
DANG WIN|JOHN|DANG 0
JOSH JOSH 0
My thought is the query would be something like this
(SUM(the frequency of NAME appears in BOSS_PATH) - 1) AS COUNT_UNDER
But I still have problem writing this as an actual query.