I have a database with repeated IDs, and I want to change the names of this repeated IDs.
So, I have a database of Vehicles and in columns I have the License number (id), the type of vehicle, the colour and also the make.
All the ids are repeated in the database, and I want to SELECT all of them except the first row of each different ID (something like a "DISTINCT id" but inverse...).
EDIT 2:
I have created this table
DROP TABLE IF EXISTS Proces1 CASCADE;
CREATE TABLE Proces1 AS
(
SELECT id_importat AS id_aux, driver_city AS city_aux, driver_state AS state_aux, gender AS g_aux, race AS r_aux
FROM ImportaViolations
WHERE id_importat IN (
SELECT id_importat
FROM ImportaViolations
GROUP BY id_importat
HAVING (COUNT(*) > 1))
GROUP BY id_importat, driver_city, driver_state, gender, race
);
And in this table I have repeated id's but with different information in the columns.
Something like:
id_aux city_aux state_aux g_aux r_aux
1 London England M WHITE
1 London England F BLACK
2 Madrid Spain M BLACK
2 London England F WHITE
2 London England M WHITE
...
So now, I want to SELECT all the rows with repeated id_aux except for the first one of each different id_aux. So I want to have this final result (in this example):
id_aux city_aux state_aux g_aux r_aux
1 London England F BLACK
2 London England F WHITE
2 London England M WHITE
...