Is a sub-select more efficient than an outer join?
SELECT cust_id FROM customers LEFT JOIN orders on customers.cust_id =
orders.cust_id WHERE orders.cust_id IS NULL;
Or am I missing something (as usual)?
Regards,
Jerry Schwartz
Global Information Incorporated
195 Farmington Ave.
Farmington,
On Fri, 20 Oct 2006, [EMAIL PROTECTED] wrote:
hi to all,
I have table customers (PK cust_id)
I have table orders (PK order_id, FK cust_id)
I need query that will selecct all customers from 'customers' they don't
have any order, there is not their cust_id in 'orders'.
couls somebody help me?
Ok. Just found I gave wrong info. To make my life easier, the person who
created db named cust_id in 'orders' table as SoldTo
[EMAIL PROTECTED]
in this case,
select cust_id from customers
where cust_id not in
(select Soldto from orders);
will not work
:(
On Fri, 20 Oct 2006, [EMAIL
On Fri, 20 Oct 2006, [EMAIL PROTECTED] wrote:
Ok. Just found I gave wrong info. To make my life easier, the person who
created db named cust_id in 'orders' table as SoldTo
[EMAIL PROTECTED]
in this case,
select cust_id from customers
where cust_id not in
(select Soldto from orders);
will