Here ColA has duplicate records based on the ColB data.
We want distinct of ColA and one ColB data. We cannot use the following query.
SELECT DISTINCT ColA, ColB FROM tableA.
Else we have to separately store the distinct values in a DS and then loop through the table again for ColB.
Instead we can use the simple GROUP BY clause
"SELECT tableA.ColA,min([tableA.ColB])FROM tableA GROUP BY [tableA.ColA]"
No comments:
Post a Comment