Utilize your financial knowledge, give your answer or opinion to the input question or subject . Answer format is not limited.

How does order matching happen in stock exchanges?
To answer your question in its entirety there's more information we need (exchange, session, traded security, order type, etc.). Most exchanges support partial fills, that is your order will be partially executed and modified.  In your example, you'd get an execution of 10 shares at $100, and your order ticket will be modified to $100 for 990 shares. Like John Bensin explained, there are ways to prevent partial filling through order modifiers (e.g. Fill-or-Kill). My addition here is, there are also ways to prevent the other bit, i.e. do the partial fill but don't keep a modified order in the system.  You'd have to mark the order Immediate-or-Cancel (IoC).  In your case you'd be partially filled (10 @$100) and that's it.  For the remaining 990 shares you'd have to enter a new order.