View Full Version : Eliminating Repeating Rows


dungstar
03-13-2002, 10:28 AM
This sounds like a simple one, but I can't get it to work.

I'm trying to figure out how to modify a table with repeating rows, so there are none.
I tried to create a SQL Query that looks like this

SELECT DISTINCTROW *
FROM Table;

The resulting has no apparent filter effect on the table. I'm not to familiar with the distinctrow command, I suppose.

Here's some sample data:

Col1 Col2 Col3
1 1 1
1 1 1
1 1 2
1 1 2
1 2 1
2 1 1
2 1 2
2 1 2

Desired results:
1 1 1
1 1 2
1 2 1
2 1 1
2 1 2

dungstar
03-13-2002, 10:37 AM
I found a solution to my own problem
Ok this is what I did
SELECT DISTINCTROW Col1 & Col2 & Col3, *
FROM Table;
This gave me an Expression field that is unique to each column.
I turned that into a table and ran a SELECT DISTINCT on the new field.

If you know of a much simpler alternative method, please let me know. Thanks.

Pat Hartman
03-13-2002, 04:37 PM
The keywords DISTINCT and DISTINCTROW are distinct so to speak http://www.access-programmers.co.uk/ubb/smile.gif and produce different results. Read about them in help to clear them up in your mind. DISTINCT would have given you the results you were after.

[This message has been edited by Pat Hartman (edited 03-13-2002).]