hi i have a query which have sales and i want it to be like where receipt no is same add the soldvalue and give me top 10 only.
select ph.txn_date_time as DATE_TIME,
(select branch_desc from branch where branch_id = ph.branch_id) as Branch_Name,
ph.receipt_no as RECEIPT_NO,
ph.assistant as logged_on_user,
ssu.username as Served_by,
ssu.firstname as Firstname,
ssu.lastname as Lastname,
pm.alt_code1 as Style
from pm_trans_header ph,
where ph.receipt_id = psd.receipt_id
and psd.salesperson_id = ssu.id
and psd.sku_id = pd.sku_id
and pd.product_id = pm.prod_id
and txn_date_time between '2006-08-01 0:00' and '2006-11-20 23:59'
--and psd.receipt_id = 221408
--and pm.alt_code1 like 'freda-%-%'
and ph.flag = 1
and ph.transaction_void = 0
and psd.flag = 1
order by Branch_name
--and ph.assistant = 'sm'
--and psd.sku like '01%'
--select * from branch
--select * from pm_trans_sku_details
--select * from pm_trans_header
/*select * from pm_trans_sku_details
--set salesperson_id = 392
where receipt_id = 221408
select * from pm_trans_header
where receipt_no = 018639
select * from ss_users
where username = 'sm'*/