Subject Re: [ib-support] subquery problem
Author Svein Erling Tysvaer
I don't quite understand what you are saying, but one way to get what you
the rows you want in your example would be

SELECT name, page, docid, id
FROM tTable t1
WHERE exists(select 1 from tTable t2 where t1.docid = t2.docid and (t1.name
<> t2.name))

This will obtain all rows with the same docid, but with different name. Is
this what you are looking for?

Set

At 10:08 19.03.2003 -0300, you wrote:
>hi !
>
>The problem I have is as follows:
>
>
>tTable=(name, page, docid, id) with an instance:
>
>('name1', 1, 1, 1)
>('name2', 2, 2, 2)
>('name3', 1, 1, 3)
>('name4', 2, 3, 4)
>
>It is needed all rows with name='name1' and name='name3' with same
>docid. From the table instance above, the result should be:
>
>
>('name1', 1, 1, 1)
>('name3', 1, 1, 3)
>
>I hope you help me.
>
>thanks,
>german