I have a database where in 2 columns some of the information is repetitive.
Ex:
col1, col2
1,2
2,4
1,3
1,2
1,2
2,5
2,4
And I want to search the rows and just pull out the unique ones, leaving out the duplicates.
So in the above example, I'd be left with:
1,2
2,4
1,3
2,5
I'm guessing an array, but can't figure out the comparison part to see which one is unique.
search for row duplicates
Moderator: General Moderators
Re: search for row duplicates
Use DISTINCT.
Code: Select all
SELECT DISTINCT * FROM `table`