Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL Statements

Status
Not open for further replies.

lusky

Programmer
Jan 4, 2002
1
CA
I want to know if it possible to get the 10 biggest accounts by value for each salesman, this is my sql statement: market value(evlmktval)

SELECT
apdadrt.accountnbr,
apdadrt.SALESMAN,
das11.EVLMKTVAL,
das11.accountnbr
FROM
pdata/apdadrt,
pdata/das11
WHERE
APDADRT.ACCOUNTNBR = DAS11.ACCOUNTNBR
order by
APDADRT.SALESMAN,das11.evlmktval DESC
 
There is an option to select the first 10 records. Off hand I don't remember what the key word is. Mike Wills
AS400 Programmer
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top