No it will not give the intended result. It will then result in 001,
005,..
 The required is to get the records under each parent supplier as
shown in the below table.

Supplier Code          Supplier Name           Total
---------------------------------------------------------------------
001                          A                             1000
         002                 B                             2000
                  003        C                             3000
                  004        D                             4000
         006                 F                             6000
---------------------------------------------------------------------
005                          E                             5000

See here 002, 003, 004, 006 are under parent supplier 001 and 005 does
not have any sub suppliers.
002 has 003 and 004 sub suppliers. How to get that result?



On Jan 8, 11:44 am, crazy <[email protected]> wrote:
> using SQL select the record  ORDER BY Supplier Name, Supplier level
>
> Using Crystal report group by records and display it.
>
>
>
>
>
> On Sat, Jan 8, 2011 at 8:35 AM, yash <[email protected]> wrote:
> > Hi :)
>
> > Consider the following  SQL table
>
> > Supplier Code | Supplier Name  | Supplier Level  | Parent Supplier |
> > Total
> > 001                  A
> > 1                  null                1000
> > 002                  B
> > 2                  001                2000
> > 003                  C
> > 3                  002                3000
> > 004                  D
> > 3                  002                4000
> > 005                  E
> > 1                  null                5000
> > 006                  F
> > 2                 001                6000
>
> > Now I want to retrieve details of the Parent suppliers and the sub
> > suppliers like below.
>
> > Supplier Code          Supplier Name           Total
> > ---------------------------------------------------------------------
> > 001                          A                             1000
> >         002                 B                             2000
> >                  003        C                             3000
> >                  004        D                             4000
> >         006                                                6000
> > ---------------------------------------------------------------------
> > 005                                                         5000
>
> > I want to get the result like above, that is, all the suppliers
> > directly or indirectly under the parent supplier. How can I get this
> > using SQL queries or using crystal reports.
>
> > Thanks in advance,
> > Best
>
> --
> "People who never make mistakes, never do anything."
>
> dEv

Reply via email to