Hi Guys,
Given the rows on PETOWNER table
ID PETID OWNER
===================================
1 1 Joe
2 2 Jane
3 3 Joey
4 4 Roy
5 3 Rey
6 6 James
7 5 Jet
===================================
Given the rows on PET table
ID ANIMALGROUPID TYPE TAGID
==========================================================
1 1 Cat 1
2 1 Cat. 2
3 1 Cat 3
4 2 Dog 10
5 3 Bird. 12
6 3 Bird 13
===========================================================
I would like to update the PETOWNER.PETID so that the final result will be:
ID PETID OWNER
===================================
1 1 Joe
2 1 Jane
3 1 Joey
4 4 Roy
5 1 Rey
6 6 James
7 6 Jet
===================================
Then delete all rows on PET table with duplicate TYPE (including those with dot (".") at the end of the type)
so that the result will be:
Note that the "Cat" type has 3 rows (1 with dot and 2 without). In this case, the 1st "Cat" without the dot will be retain.
ID ANIMALGROUPID TYPE TAGID
=======================================================
1 1 Cat 1
4 2 Dog 10
6 3 Bird 13
=======================================================
Thanks in advance,
Yorge
Given the rows on PETOWNER table
ID PETID OWNER
===================================
1 1 Joe
2 2 Jane
3 3 Joey
4 4 Roy
5 3 Rey
6 6 James
7 5 Jet
===================================
Given the rows on PET table
ID ANIMALGROUPID TYPE TAGID
==========================================================
1 1 Cat 1
2 1 Cat. 2
3 1 Cat 3
4 2 Dog 10
5 3 Bird. 12
6 3 Bird 13
===========================================================
I would like to update the PETOWNER.PETID so that the final result will be:
ID PETID OWNER
===================================
1 1 Joe
2 1 Jane
3 1 Joey
4 4 Roy
5 1 Rey
6 6 James
7 6 Jet
===================================
Then delete all rows on PET table with duplicate TYPE (including those with dot (".") at the end of the type)
so that the result will be:
Note that the "Cat" type has 3 rows (1 with dot and 2 without). In this case, the 1st "Cat" without the dot will be retain.
ID ANIMALGROUPID TYPE TAGID
=======================================================
1 1 Cat 1
4 2 Dog 10
6 3 Bird 13
=======================================================
Thanks in advance,
Yorge