Subject | Re: [firebird-support] Unable to create unique constraint |
---|---|
Author | Svein Erling Tysvær |
Post date | 2014-03-21T06:04:44Z |
>1) You don't want to use indexes in your select (errors in the index may give wrong results), so try:Oops, I forgot index problems could lead to there being NULL or duplicates in the PK field, so change the above query to:
> select
> T.F1+0,
> T.F2+0,
> count(T.ID+0)
> from
> T
> group by
> 1, 2
> having
> count(T.ID+0) > 1
select
T.F1+0,
T.F2+0,
count(*)
from
T
group by
1, 2
having
count(*) > 1
Set