I'm not sure how to do this with a sql query.
I have a table that contains "duplicate" records. (I quote duplicate because they are not true duplicates)
Heres the issue, i have a table that looks like this...
So say for example I have a dataset like so..
I want a query that will return the first two records because folder,block,place_id as a whole exist more than once in the database. (hope that makes sense)
Heres the background behind my problem. A client had a large set of paper documents that kept track of the work they had done for a specific piece of property. Well say that did a piece of work on Lot 4 and then later on Lot 5, they never updated their initial record to say "Lots 4,5". They instead made a new entry with "Lot 5". So when they started adding data to the SQL database, they did it the same way it was on paper. So there are a lot of entries in the database that should consolidated into one record but haven't because of the way the data was entered. Thus i need this query to see which set of records need updated/deleted.
Any help would be appreciated. I tried using the concat function on those 3 fields and then counting that new concat field but it wont allow me. (Says it cant find the field) This is on a mysql 5.0 server.
I have a table that contains "duplicate" records. (I quote duplicate because they are not true duplicates)
Heres the issue, i have a table that looks like this...
Code:
+----+--------+-------+----------+-------------+
| id | folder | block | place_id | description |
+----+--------+-------+----------+-------------+
So say for example I have a dataset like so..
Code:
1 | 2345 | 2 | 2 | lot 4
2 | 2345 | 2 | 2 | lot 5
3 | 7349 | 6 | 7 | lots 3,4
I want a query that will return the first two records because folder,block,place_id as a whole exist more than once in the database. (hope that makes sense)
Heres the background behind my problem. A client had a large set of paper documents that kept track of the work they had done for a specific piece of property. Well say that did a piece of work on Lot 4 and then later on Lot 5, they never updated their initial record to say "Lots 4,5". They instead made a new entry with "Lot 5". So when they started adding data to the SQL database, they did it the same way it was on paper. So there are a lot of entries in the database that should consolidated into one record but haven't because of the way the data was entered. Thus i need this query to see which set of records need updated/deleted.
Any help would be appreciated. I tried using the concat function on those 3 fields and then counting that new concat field but it wont allow me. (Says it cant find the field) This is on a mysql 5.0 server.