This error is coming because you may have duplicate values in T1 of your primary index.
Since you are trying to insert duplicate records in T2 which is Unique primary index you are getting this error.
Scenarios you mentioned.
This will give error if the T1 is having duplicate records of primary index.
Though T1 got NOT NULL values if primary index got duplicates it will get the same error.
This scenario is same as you presented... and it got errore'd
This scenario is same as you presented... and it got errore'd
As kapil mentioned you need to check if you got any duplicate records in primary index of T1 if yes then you have to either change T2 to NUPI
or delete the duplicate Records form T1 :-)
Select A, B, C, COUNT(*)
FROM T1
GROUP BY 1, 2, 3 HAVING COUNT(*) > 1
Thanks & Regards
|
| |
|
|
|
|
| |
| |
|
|
Copyright 2016 - All Rights Reserved |
Last Modified: 15 Jun 2023 |
|