I have a table with the following:
ID | ORDER | P_ID |
1234 | 0 | 123456 |
1234 | 0 | 654321 |
4567 | 0 | 456123 |
4567 | 1 | 456123 |
4567 | 2 | 456123 |
4567 | 0 | 987654 |
4567 | 1 | 987654 |
4567 | 2 | 987654 |
7890 | 0 | 495874 |
7890 | 0 | 123498 |
7890 | 0 | 684259 |
7890 | 0 | 154980 |
I want to say delete all but the largest numerical instances of records having count([ID]) > 1 and count([ORDER]) > 1. So my output of select * from table after delete would be:
ID | ORDER | P_ID |
1234 | 0 | 654321 |
4567 | 0 | 987654 |
4567 | 1 | 987654 |
4567 | 2 | 987654 |
7890 | 0 | 684259 |
Having a heck of a time figuring this one out... help is GREATLY appreciated!!! Thanks.