Select - Top 10
5 pts.
0
Q:
Select - Top 10
Hello,

I have to tables, one with name CONTRACT, second AGENT

IN table CONTRACT these data:

ClientID
ClientName
ClientSurname
ContractNR
AgentID

AGENT data:

ClientID
Sum
ContractNR

I need to select 10 agent's clients, who have a bigest sum.
One agent have 100 clients, second only 2 or one client. Sum is very different.

The result may be :

     clientID                  contractId      AgentID     Sum
1     48504051021         000001         112          10,15
2     54847584527         000002         112          20,26
.
.
.
10   45985485425         0001251       112           200,32


1     85462455545         0000125       156           100,65
.
.
.
10    23654755875        000056         156           900,23
ASKED: Nov 2 2009  9:02 AM GMT
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
0
1840 pts.
0
A:
 RATE THIS ANSWER
0
Click to Vote:
  •   0
  •  0
  • AddThis Social Bookmark Button
This is a typical homework assingment and I will not answer.
I will give you a hint:
SUB-SELECT and maybe a nested table expression.

Steve
Last Answered: Nov 2 2009  3:27 PM GMT by Meandyou   1840 pts.
0
0
Discuss This Answer:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _



0