Miners would likely favour the transaction with the higher fee. If the first transaction used a really low fee and is unconfirmed at the time the second transaction was created, then the second one would likely be confirmed first.
Sorry to intrude..
what if the first later confirmed, i have been among such case before whereby sending out transaction and was to slow and i couldn't able to way for the previous and i got initiated another transaction and the both confirmed the point of waiting for the previous.
please reply and don't find any offense towards my questions.
I want to learn more
I have a hard time understanding what you're saying... But basically, one unspent output can only be spent in one confirmed transaction.
Once a transaction spending a certain unspent output is confirmed, all unconfirmed transactions spending the same unspent output become invalid.
As a fictional example:
I fund address 1Address with an unspent output with value 0.001 BTC in transaction with transactionid abcdefghijklmnop and the transaction gets confirmed.
At this point, i can create transactions with tx id qsdfkmjiuqdsfqsdf and miuqpdfiousdfsdf both using unspent output abcdefghijklmnop with value 0.001 as an input. HOWEVER, only one of these transactions can EVER make it into a block. Once one of the two transactions gets confirmed, the other one gets kicked from all the mempools of all the nodes that have the other transaction in their mempool. If a miner would put the other transaction into a block, the block would become invalid and all the nodes of the network would reject said block.