Presumably, the OrderID must be unique for each (obviously) and there will be multiple lines per order, so multiple lines in the OrderContent table with the same OrderID, pertaining to one particular order....
In this case, I would have a "control table", where by I hold the next order number, then I would include this table in the SELECT statement part of the INSERT query.
After inserting a record in the OrderContent table, run an update query on the control table to increment the order number.
IE:
1. create a table called ControlTBL with 2 fields; Description (text) and ItemValue (number/double).
2. Add one record to the table like so:
Description ItemValue
OrderNumber 1
3. Use the INSERT query:
INSERT INTO OrderContent(OrderID, MerchantID, Quantity) SELECT ControlTBL.ItemValue, BasketContent.MerchantID, BasketContent.Quantity FROM BasketContent, ControlTBL WHERE BasketContent.BasketID = BasketID AND ControlTBL.Description="OrderNumber"
(Note that this has not been tested, so you may have to play around with the select statement, but I think it is OK)
4. Run the query:
UPDATE ControlTBL SET ItemValue=ItemValue+1 WHERE Description="OrderNumber"
(Note that I put the extra where clause - Description="OrderNumber" - on the two queries as the ControlTBL could then be used for other things, like CustomerNumber, InvoiceNumber,....)
Simon