6 Replies Latest reply: Nov 20, 2012 12:58 AM by 963994 RSS

    top 10 customers

    963994
      Hi,
      I have 7 branches and n number of customers in each branch , how can i get only top 10 customers net sale value from the tables into the report.
      thank you

      Edited by: 960991 on Oct 9, 2012 6:30 AM

      Edited by: 960991 on Oct 9, 2012 6:56 AM
        • 1. Re: top 10 customers
          naviNkumArG
          hi,

          take a look at the below select statement,

          SELECT r, branch_code, customer_name, net_sale
          FROM (SELECT ROWNUM r, branch_code, customer_name, net_sale
          FROM (SELECT branch_code, custome_name, net_sale
          FROM branch_master
          ORDER BY net_sale DESC))
          WHERE r <= 10;

          hope it could help you...
          • 2. Re: top 10 customers
            naviNkumArG
            hi,

            take a look at the below select statement,

            SELECT r, branch_code, customer_name, net_sale
            FROM (SELECT ROWNUM r, branch_code, customer_name, net_sale
            FROM (SELECT branch_code, custome_name, net_sale
            FROM branch_master
            ORDER BY net_sale DESC))
            WHERE r <= 10

            hope it could help you.
            • 3. Re: top 10 customers
              963994
              hi,

              take a look at the below select statement,

              SELECT r, branch_code, customer_name, net_sale
              FROM (SELECT ROWNUM r, branch_code, customer_name, net_sale
              FROM (SELECT branch_code, custome_name, net_sale
              FROM branch_master
              ORDER BY net_sale DESC))
              WHERE r <= 10

              hope it could help you.

              Hi,
              no dought this is correct query in sqlplus , but i need a query in reports 6i.

              looking for help ...
              • 4. Re: top 10 customers
                963994
                Hi,
                The above query is working in sqlplus , but i need the out put in reports ,in report if you use query inside query it is giving error. so please can any one give me report query builder query(I mean to say single query).
                please help me.
                • 5. Re: top 10 customers
                  naviNkumArG
                  I hope the same will be work in report 6i, could you please post the error you are facing ?

                  Thanks.
                  • 6. Re: top 10 customers
                    963994
                    thanks