This discussion is archived
6 Replies Latest reply: Nov 19, 2012 10:58 PM by 963994 RSS

top 10 customers

963994 Newbie
Currently Being Moderated
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 Newbie
    Currently Being Moderated
    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 Newbie
    Currently Being Moderated
    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 Newbie
    Currently Being Moderated
    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 Newbie
    Currently Being Moderated
    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 Newbie
    Currently Being Moderated
    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 Newbie
    Currently Being Moderated
    thanks

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points