Subject Re: [firebird-support] Re: duplicate string fields?
Author Woody
ifitsx wrote:
> Let me review what I'm trying to do.
>
> 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.
>
How about something like this:

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)