Combining multiple rows in single row based on certain condition using awk or sed

Hi,

I'm using AIX(ksh shell).

> cat temp.txt

"a","b",0
"c",bc",0
"a1","b1",0
"cc","cb",1
"cc","b2",1
"bb","bc",2

I want the output as:

"a","b","c","bc","a1","b1"
"cc","cb","cc","b2"
"bb","bc"

I want to combine multiple lines into single line where third column is same.

Is it possible through paste,sed or awk commands?

Regards,
Sam

awk -F, '{a[$3]=(a[$3])?a[$3]","$1:$1;a[$3]=a[$3]","$2}END{for (i in a){print a}}' file