need help in PLSQL [message #265052] |
Wed, 05 September 2007 05:54  |
sonalshastry
Messages: 52 Registered: September 2007
|
Member |
|
|
i have several recods for a client who trades but i wants to retrive only frist two records of the trades comiited by a particular client & the total clients are 25600
this is the basic qurey
select distinct cnm.cnm_ent_id, cnm_date,
cnm.cnm_brokerage_amt Brokerage,
sum(cd.cnd_qty * cd.cnd_price) Turnover
from contract_note_master cnm,contract_note_details cd
where cnm.cnm_no = cd.cnd_cnm_no
and cnm.cnm_sd_stage <> 'C'
and cd.cnd_stage <> 'C'
and cnm.cnm_ent_id in ('30000' , '270576', '307246')
group by cnm_ent_id,cnm_date,cnm_brokerage_amt
order by cnm_ent_id,cnm_date
plz help me
|
|
|
|
Re: need help in PLSQL [message #265057 is a reply to message #265052] |
Wed, 05 September 2007 06:00   |
dhananjay
Messages: 635 Registered: March 2002 Location: Mumbai
|
Senior Member |
|
|
hi,
information given by you is insufficient to understand your requirement.ananlytical functions might of some help to you.
regards,
|
|
|
|
Re: need help in PLSQL [message #265064 is a reply to message #265058] |
Wed, 05 September 2007 06:06   |
sonalshastry
Messages: 52 Registered: September 2007
|
Member |
|
|
thanks for your advice
& i have tried it before but rownum gives me only first two rows of first client rest of the client are not diasplyed in result set
plz advice some other way
|
|
|
|
|
|
Re: need help in PLSQL [message #265079 is a reply to message #265057] |
Wed, 05 September 2007 06:26   |
sonalshastry
Messages: 52 Registered: September 2007
|
Member |
|
|
i have 1 client performing many trades but i just want 1st 2 trade of that client
there are 25600 client
& i have tried rownum function also it give only 1 client data at a time
i hope it's ok now
|
|
|
|
|