Thanks for the reply diosys.I was actually confused about this reading http ://www .personalfn. com/tax/faqshares.html
where it says
In case of multiple demat accounts, the capital gains on sale of shares has to be computed on the basis of the FIFO with reference to the particular account...