3
I have a table in my database and I would like to mark the occurrences where a certain code is repeated. Remembering that this code field is not a primary key.
Example:
Data Código Repetição Status ...
25/2/2014 138863 ok C96 ...
25/2/2014 387707 ok C96 ...
25/2/2014 387707 nok C96 ...
25/2/2014 387707 nok C96 ...
25/2/2014 387707 nok C96 ...
25/2/2014 1845141 ok C96 ...
25/2/2014 1845141 nok C96 ...
25/2/2014 1845141 nok C96 ...
25/2/2014 1845141 nok C96 ...
25/2/2014 1845141 nok C96 ...
25/2/2014 1845141 nok C96 ...
Does anyone have any idea how I can create the repeat column with the above logic (first occurrence, mark as ok
, in the other nok
) using some query?
At the moment I am using this table in a Access Database.
Use the GROUP BY clause and count the number of repetitions. The HAVING cont(*) > 1 clause can help you filter only repetitions.
– user4552
You can ask the question the source tables?
– Leonel Sanches da Silva