Subject Re: Select records with duplicate fields
Author Adam
--- In firebird-support@yahoogroups.com, "markd_mms" <spam@...> wrote:
>
> This is probably a real easy question but I've never had to do it
> before and for the life of me I can't figure it out.
>
> I have a table that lists actor id's and title id's for a video
> database and I just need to list actor id's where there are duplicate
> title id's.
> e.g.
>
> actor_id title_id
> 1 1
> 2 1
> 3 2

Note:

Read Helen's Post, this is more efficient if the tables are normalised.

select actor_id
from actortitle
group by actor_id
having count(*) > 1

Adam