Showing only unique values!

chrisbrooke

New member
Local time
Today, 01:15
Joined
Sep 4, 2003
Messages
9
Hi, is there a way of showing only unique values, i.e. say the data was 111,2,2,3,444 for a particular field say name, of which is dave. What I want is a query with results that show for name=dave the results should be 1,2,3,4 and not the whole lot - just the different numbers.
 
Can't think of an easy way to do this. Just curious, why would you want to?

If I had to, I'd write a custom function, pass each number as a string to it, parse each character in the string, and work with a boolean array of 9 Yes/No variables (or 10 if you want to track 0) to keep track. You could then return a comma-separated list back.
 
If the values list is contained within a single column, you'll need to write your own code to obtain a solution. If the values exist as separate rows, then a query will find the unique items for you.

Select Distinct YourNameField, YourOtherField
From YourTable
Order By YourNameField, YourOtherField;
 

Users who are viewing this thread

Back
Top Bottom