<div dir="ltr"><div><div>Olá pessoal,<br><br>Tenho um banco com registros repetidos por linha e gostaria de colocar o mesmo identificador (contador) para os registros que são repetidos baseado em alguns atributos. Por exemplo, se o existirem 4 registros com o mesmo nome, nome da mãe e data de nascimento, o identificador será o mesmo.<br><br>Segue um exemplo do meu banco de dados:<br><br>
<table border="0" cellspacing="0">
<colgroup width="63"></colgroup>
<colgroup width="61"></colgroup>
<colgroup width="84"></colgroup>
<colgroup width="120"></colgroup>
<tbody><tr>
<td align="center" height="17">Registro</td>
<td align="center">Nome </td>
<td align="center">Nome Mãe </td>
<td align="center">Data Nascimento</td>
</tr>
<tr>
<td align="center" height="17">1</td>
<td align="center">João</td>
<td align="center">Maria</td>
<td align="center">1976-09-08</td>
</tr>
<tr>
<td align="center" height="17">2</td>
<td align="center">Manuel</td>
<td align="center">Selma</td>
<td align="center">1988-03-10</td>
</tr>
<tr>
<td align="center" height="17">3</td>
<td align="center">João</td>
<td align="center">Maria</td>
<td align="center">1976-09-08</td>
</tr>
<tr>
<td align="center" height="17">4</td>
<td align="center">João</td>
<td align="center">Maria</td>
<td align="center">1976-09-08</td>
</tr>
<tr>
<td align="center" height="17">5</td>
<td align="center">Ricardo</td>
<td align="center">Sonia</td>
<td align="center">1990-05-12</td>
</tr>
<tr>
<td align="center" height="17">6</td>
<td align="center">Marcelo</td>
<td align="center">Marta</td>
<td align="center">1987-08-06</td>
</tr>
<tr>
<td align="center" height="17">7</td>
<td align="center">Ricardo</td>
<td align="center">Sonia</td>
<td align="center">1990-05-12</td>
</tr>
<tr>
<td align="center" height="17">8</td>
<td align="center">João</td>
<td align="center">Maria</td>
<td align="center">1976-09-08</td>
</tr>
<tr>
<td align="center" height="17">9</td>
<td align="center">Ricardo</td>
<td align="center">Sonia</td>
<td align="center">1990-05-12</td>
</tr>
<tr>
<td align="center" height="17">10</td>
<td align="center">Marcelo</td>
<td align="center">Marta</td>
<td align="center">1987-08-06</td>
</tr>
</tbody></table>
<br clear="all"></div>Gostaria obter esse banco com o identificador ID:<br><br>
<table border="0" cellspacing="0">
<colgroup width="63"></colgroup>
<colgroup width="75"></colgroup>
<colgroup width="84"></colgroup>
<colgroup span="2" width="120"></colgroup>
<tbody><tr>
<td align="center" height="17">Registro</td>
<td align="center">ID</td>
<td align="center">Nome </td>
<td align="center">Nome Mãe </td>
<td align="center">Data Nascimento</td>
</tr>
<tr>
<td align="center" height="17">1</td>
<td align="center">1</td>
<td align="center">João</td>
<td align="center">Maria</td>
<td align="center">1976-09-08</td>
</tr>
<tr>
<td align="center" height="17">2</td>
<td align="center">2</td>
<td align="center">João</td>
<td align="center">Selma</td>
<td align="center">1988-03-10</td>
</tr>
<tr>
<td align="center" height="17">3</td>
<td align="center">1</td>
<td align="center">João</td>
<td align="center">Maria</td>
<td align="center">1976-09-08</td>
</tr>
<tr>
<td align="center" height="17">4</td>
<td align="center">1</td>
<td align="center">João</td>
<td align="center">Maria</td>
<td align="center">1976-09-08</td>
</tr>
<tr>
<td align="center" height="17">5</td>
<td align="center">3</td>
<td align="center">Ricardo</td>
<td align="center">Sonia</td>
<td align="center">1990-05-12</td>
</tr>
<tr>
<td align="center" height="17">6</td>
<td align="center">4</td>
<td align="center">Marcelo</td>
<td align="center">Marta</td>
<td align="center">1987-08-06</td>
</tr>
<tr>
<td align="center" height="17">7</td>
<td align="center">3</td>
<td align="center">Ricardo</td>
<td align="center">Sonia</td>
<td align="center">1990-05-12</td>
</tr>
<tr>
<td align="center" height="17">8</td>
<td align="center">1</td>
<td align="center">João</td>
<td align="center">Maria</td>
<td align="center">1976-09-08</td>
</tr>
<tr>
<td align="center" height="17">9</td>
<td align="center">3</td>
<td align="center">Ricardo</td>
<td align="center">Sonia</td>
<td align="center">1990-05-12</td>
</tr>
<tr>
<td align="center" height="17">10</td>
<td align="center">4</td>
<td align="center">Marcelo</td>
<td align="center">Marta</td>
<td align="center">1987-08-06</td>
</tr>
</tbody></table>
<br><br></div>Muito obrigado a todos,<br><div><div>-- <br><div class="gmail_signature">Wagner S. Tassinari<br>Departamento de Matemática<br>Universidade Federal Rural do Rio de Janeiro.<br>BR-465, Km 7 - Seropedica, RJ - Brasil<br>CEP: 23890-000 <br>Skype: wagner.tassinari<br><a href="mailto:wtassinari@gmail.com" target="_blank">wtassinari@gmail.com</a><br><a href="mailto:tassinari@ufrrj.br" target="_blank">tassinari@ufrrj.br</a><br>-------------------------------------------------------<br>"Statistical thinking will one day be as necessary for efficient citizenship as the ability to read and write." (H.G.Wellis)<br></div>
</div></div></div>