Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Complicated query: searching for results within results.
That is very easy. You want to know if the number of distinct Bs is the
same as of distinct B/C combinations:
select case when count(distinct B) <> count(distinct B||'-'||C) then
'true' else 'false' end
from MyTable
where A = :GivenA
PS: I understand Daniel's remark not to solve student's tasks, but there is no way for us to determine, if the poster is a student or not. So I prefer to give a good answer that not only solves the problem, but also explains how to get to the solution for the learning effect. In this particular case however, the solution is so simple that you either find it immediately or you sit there for hours and hours, becuase the idea doesn't come to your mind. There is not much to learn.
![]() |
![]() |