If you need three columns, then your select
needs three columns. If you want unique combinations:
select distinct a, b, c
from TableName;
Is this what you want?
I suspect that you want lists of the unique ids in three columns. You can do this using variables in MySQL:
select rn, max(a) as a, max(b) as b, max(c) as c
from ((select @rna := @rna + 1 as rn, a, null as b, null as c
from (select distinct a from TableName) t cross join
(select @rna := 0) const
) union all
(select @rnb := @rnb + 1 as rn, null, b, null
from (select distinct b from TableName) t cross join
(select @rnb := 0) const
) union all
(select @rnc := @rnc + 1 as rn, null, null, c
from (select distinct c from TableName) t cross join
(select @rnc := 0) const
group by c
)
) abc
group by rn
order by rn;
Here is an example of it working in SQL Fiddle.