| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> comp.databases.theory -> Re: Can I do this using SQL?
I assume that a big balance is how you rate the branches.
DECLARE BestTenBranches CURSOR FOR
SELECT branch_name, SUM(acct_balance) AS activity_tot, COUNT(cust_id)
AS cust_tally
FROM BranchActivity
GROUP BY branch_name
ORDER BY activity_tot;
The TOP n operator is a SQL Server extension, but you can do this with a cursor in Standard SQL, as shown. Received on Thu Feb 09 2006 - 20:55:28 CST
![]() |
![]() |