Subject Re: [firebird-support] Re: Show individual duplicates
Author Sergio H. Gonzalez
> The table looks like this (still simplisticly)

> people
> ID,Name,AssignedValue
> 1,A,1
> 2,B,1
> 3,C,2
> 4,D,1
> 5,E,2
> 6,F,3

> I want my output to be:
> ID,Name,AssignedValue
> 1,A,1
> 2,B,1
> 4,D,1
> 3,C,2
> 5,E,2

I would do it with a selectable SP... something like this (incomplete and
untested)
Don't know about the performance though...

[...]

for
select ID,Name,AssignedValue
from people
into :loc_ID,:loc_Name,:loc_AssignedValue
do
begin

if (exists (select id
from people
where (id <> :loc_id) and
(AssignedValue = :loc_AssignedValue))) then
begin
suspend;
end

end