MrRSMan
12-27-2009, 12:25 AM
I have a field in my database with values that INCREASE (they never decrease). I need to find a way of selecting the NON-DUPLICATE rows.
NUM
1
2
2
3
4
4
4
4
5
5
6
7
8
8
IMPORTANT
The DISTINCT keyword is no use to me. By using the distinct keyword for the example above I'd be left with only the values that occur once. But I also want ONE OF EACH of the duplicated rows to be left as well.
So the example above would become:
NUM
1
2
3
4
5
6
7
8
This is because the values that occur only once are selected (this is what DISTINCT does) but then the values that occur multiple times are selected only ONCE.
I'm sorry if I sound like I've over-explained this, but I've had trouble trying to tell people what I need- people keep recommending the DISTINCT keyword.
Thanks in advance- I hope you can help.
NUM
1
2
2
3
4
4
4
4
5
5
6
7
8
8
IMPORTANT
The DISTINCT keyword is no use to me. By using the distinct keyword for the example above I'd be left with only the values that occur once. But I also want ONE OF EACH of the duplicated rows to be left as well.
So the example above would become:
NUM
1
2
3
4
5
6
7
8
This is because the values that occur only once are selected (this is what DISTINCT does) but then the values that occur multiple times are selected only ONCE.
I'm sorry if I sound like I've over-explained this, but I've had trouble trying to tell people what I need- people keep recommending the DISTINCT keyword.
Thanks in advance- I hope you can help.