我正在使用以下查询:
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;
查询返回的数据如下:
clst bitpos
clst cid
clst colguid
clust cmprlevel
clust fgidfs
clust fillfact
但是,我想查看以下数据:
clst bitpos, cid, colguid
clust cmprlevel, fgidfs fillfact
我这样尝试过与众不同和分组。但这不起作用:
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;
任何人都可以帮忙。我正在使用mssql