You asked: How to
somehow select ordno from invoice table only once
You could do that by adding
ordno NOT IN (SELECT DISTINCT ordno FROM invoices) ;
... but there is absolutely no reason to do it, if there is an index on
invoices(ordno). You can test of course, but the explain plan should be the same and the execution times identical.
(the situation may be different if the
invoices is not a base table but a complex view that returns thousands of identical order numbers).
You should also check if the two variations proposed in other answers are more efficient with your data distribution. I wouldn't expect much difference. This blog article Explain Extended: NOT IN vs. NOT EXISTS vs. LEFT JOIN / IS NULL: MySQL has some tests that support that but it's never bad to test with your data and table sizes, in your envirorment.
What you should really check first of all, is whether you have an index on
orders(ordno) and on
invoices(ordno) and whether these two columns, are of the same datatype.
If there are no indices, add them. If the two columns are of different datatype, change them into the same datatype.