If this is your first visit, be sure to check out the FAQ by clicking the link above.
You may have to register before you can post: click the register link above to proceed.
To start viewing messages, select the forum that you want to visit from the selection below.
Should I worry about the performance of a query like:
SELECT CustomerID FROM invoices WHERE InvoiceID NOT IN (SELECT TOP 50% InvoiceID FROM invoices)
What if the "invoices" is very big?
i would not worry about performance until you can define what "very big" means
also, in the example you gave, you really should have an ORDER BY in the subquery, otherwise it doesn't make sense to pull 50% of all the invoices randomly
The query I used for exemplification doesn't make much sense. My real query it's totaly different but I'm affraid that the inner SELECT will return too many records (hundreds of thousands maybe).