showing only duplicate lines

hello,

normally, each customer has an unique stat number. but we find that there are many customers who have the same stat number : we want to show these customers.

the table customers : stat_number/customer_number
01 A
02 B
02 C
03 D
04 E
04 F
04 G
05 H

the result must be
02 B
02 C
04 E
04 F
04 G

i use the previous function

= If <Stat_number>=Previous(<Stat_number>) Then "Duplicate" Else "OK"

but i can’t filter.

i did a search and found this.
but can someone re-explain this post?

i don’t care if the solution is at report or designer level. we use oracle.

thanks

EDIT : more research and i find this very helpful topic. it works.


azertyh :madagascar: (BOB member since 2005-10-27)

By Designer do you mean free-hand sql? to get that in free-hand all you have to do is

select
stat_number,
customer_number
from
(
select
stat_number
from
table1
having
count(stat_number) > 1
group by
stat_numer
) Inner_query
where
table1.stat_number = inner_query.stat_number

there’s a way to do it in BO but sometimes I find it easier to just write in free-hand…


mbersiam :us: (BOB member since 2010-02-10)