Subject | Re: [firebird-support] Re: duplicate string fields? |
---|---|
Author | Woody |
Post date | 2008-02-07T20:00:53Z |
ifitsx wrote:
select a.noteid, a.folderid, a.subject from dbnotes a
where exists (select 1 from dbnotes b where a.subject = b.subject and
a.noteid <> b.noteid and a.folderid <> b.folderid)
order by 3, 1, 2
This is untested but it should list out the record id fields that have
duplicates and ordered by the subject, noteid, folderid fields.
Ann, feel free to jump in with any corrections. :-)
Woody (TMW)
> Let me review what I'm trying to do.How about something like this:
>
> I'm only searching one table: dbnotes.
>
> This is a new table created by merging many tables from another db.
>
> There are a very few duplicate fields for <subject>.
>
> I need to find those to evaluate which one to keep.
>
select a.noteid, a.folderid, a.subject from dbnotes a
where exists (select 1 from dbnotes b where a.subject = b.subject and
a.noteid <> b.noteid and a.folderid <> b.folderid)
order by 3, 1, 2
This is untested but it should list out the record id fields that have
duplicates and ordered by the subject, noteid, folderid fields.
Ann, feel free to jump in with any corrections. :-)
Woody (TMW)