I tagged sql in here because apparently the query function uses the same syntax.
My goal is for:
EX:
If I query column B for "Heavy lifting/straining", the cell in column G will show "Musculoskeletal, Herniation"
try this:
=JOIN(", "; FILTER(A:A; B:B=E7))
for partial matches:
=JOIN(", ", FILTER(A:A, REGEXMATCH(B:B, E8)))