I have 3 MySQL tables called 'orders', 'orders_queue' and 'orders_sent'. The order number is primary key for all these tables, for orders table it's called "num", for orders_queue it's "ordernum" and for orders_sent it's "order_id".

Clause: List max 10 order numbers sorted by Rand() that exist in table 'orders' but do not exist in 'orders_queue' nor in 'orders_sent' OR if it exists in 'orders_sent', these lines have also a field called 'foo' set to ''.