Example of my table:
Table_1
+-----id-----+-----zone-----+-----address-----+-----status-----+
=============+==============+=================+================+
1 5 10 ok
2 2 8 ok
3 3 2 ok
4 2 5 ok
5 3 2 ok
6 5 10 ok
7 3 2 ok
I need to check the duplicate entries [zone/address combination] and have the table like this:
Table_1
+-----id-----+-----zone-----+-----address-----+-----status-----+
=============+==============+=================+================+
1 5 10 ok
2 2 8 ok
3 3 2 ok
4 2 5 ok
5 3 2 duplicate
6 5 10 duplicate
7 3 2 duplicate
The query should check the duplicate combination of zone, address and should update the ‘status’ column.
I need to keep the first duplicate data status unchanged and the rest of the repeated data should be marked as ‘duplicate’?
Any ideas on how to do this?
You could use this: