I have a spreadsheet with a lot of data that I save as a CSV file and import into a MySQL database table. One column contains dynamic URL's for my website, like this...
I want to retain the duplicate rows (e.g. Arizona_Flower) in this particular table. However, I need to create an additional table that features this column only, and without duplicates. In fact, this will be the table that creates the pages.
So I'd like to know if there's a quick, easy way of locating duplicate rows. I don't want to delete them (yet), as I need to find the same rows in my Excel spreadsheet and mark them accordingly. In other words, I'm going to use the same spreadsheet to create both tables. So I simply want to mark the duplicate rows as duplicates and sort them to the bottom of the file when I'm creating the table without duplicate rows.
So imagine if my spreadsheet, and the database table I create with it, have the following duplicate rows:
Is there some sort of query I can write that will display those rows and those rows only?
(I'm aware of the GROUP BY function, which I can use as a last resort. I just thought it might be a little time consuming. I'd have to display a list of rows via GROUP BY, then paste it into my spreadsheet and compare it to the column with the duplicates. It would be faster if I can simply get a list of duplicate rows.)
a list of duplicate rows when there's only one column in the row is trivial...
HAVING COUNT(*) > 1
Wow, thanks for the tip! That's going to help me clean up all my database tables.