Are you asking something like this?:
A. Buy 100 ANZ shares at $20 each,
B. then a week later buy another 100 ANZ shares at $22 each.
1 year later sell 100 ANZ shares. Which shares had you sold, A or B?
I'v often wondered about this myself, but don't know the answer for sure, but I...