Re: [Q, theory] how to write complicated query?

From: Alexey E. Neckrasow <nec_at_leaves.spb.su>
Date: 1996/09/13
Message-ID: <32392BAA.5DE6_at_leaves.spb.su>#1/1


Hi, Igor

Maybe I misunderstand your question, but maybe this is the solution (in case there is unique constraint on Master.name):

SQL> select M.pkey
  2 from M, D
  3 where M.pkey = D.fkey_master
  4 group by M.pkey, M.name, D.num;

or simplier:

SQL> select M.pkey
  2 from M, D
  3 where M.pkey = D.fkey_master
  4 group by M.pkey, D.num;

Igor M. Klinchin wrote:
>
> Hi, folks!
>
> We have one problem and not understand now is this an our problem
> or the real problem. So two tables
>
> Master
> ------
> pkey,
> name
>
> Detail
> ------
> pkey,
> fkey_master references master(pkey),
> num number -- some positive integer
>
> We need select all pkey's from Master grouping them by
> name
> and equal sets of Detail.num.
>
> We are interested not only with particular solution using
> native oracle methods but with solution using standard SQL.
>
> With best wishes,
>
> dk
 

-- 
Regards. Alexey Neckrasow. Leaves Inc. Russia.
Received on Fri Sep 13 1996 - 00:00:00 CEST

Original text of this message