I am querying a list of all IterationIDs and their corresponding IterationPath. The following code works and produces a long list with several repeated rows:
WorkItemCollection queryResults = workItemStore.Query(
"Select [System.IterationID], [System.IterationPath] " +
"From WorkItems");
foreach(WorkItem workitem in queryResults)
{
Console.WriteLine("IterationID: {0}\t IterationPath: {1}", workitem.IterationId, workitem.IterationPath);
}
I am attempting to select only distinct rows, sadly the DISTINCT
clause does not seem to work with WIQL as it does in SQL. Is creating this list possible using WIQL?
Unfortunately,
DISTINCT
queries are not supported with WIQL syntax. (Also have tried)However, if you only want to make the rows unique, you can also using SQL on the Relational Warehouse to query Work Items. Details about it you can refer this link: How to query Work Items using SQL on the Relational Warehouse