Quote:
Originally posted by cvandemaele
Try this.
Select cust_name, acct_type
From customer t1
Where t1.cust_name in
(select t2.cust_name from customer t2 where t2.acct_type = t1.acct_type and rownum <=) 10
|
Thank you for these replies
I have been using this sql but unfortunately it is brining back a lot less rows than I expect.
I now want to show 10 receipt transactions for each account type.
I am using the following but it is only selecting 4 rows, I now for a fact there were 2900 cheque transactions going to 13 different account types during September.
select tran_account_no,
tran_amount_cr,
tran_date,
tran_pay_method,
tran_act_code
from transactions,accounts
where tran_account_no = acc_account_no
and tran_gtrans_type = 'R'
and tran_pay_method = 'Q'
and tran_date >= '01-SEP-2003'
and tran_date <= '30-SEP-2003'
and tran_account_no in (select acc_account_no from accounts where tran_act_code = acc_act_code and nownum <=10)
order by tran_act_code
;
The information is needed for system testing, I want a random-is selection of data.
Thanks everyone
Beth