I'm using below query :
select i.name as 'index name',c.name as 'column' from sys.indexes i
join sys.columns c on i.object_id = c.object_id;
the query is returning me data like :
clst bitpos
clst cid
clst colguid
clust cmprlevel
clust fgidfs
clust fillfact
However, I want to see my data like:
clst bitpos, cid, colguid
clust cmprlevel, fgidfs fillfact
I tried with distinct and group by like this. But it's not working:
select distinct(i.name) as 'index name',c.name as 'column' from s
ys.indexes i join sys.columns c on i.object_id = c.object_id group by i.name;
Could any one please help with this. I'm using mssql