MySQL Forums
Forum List  »  InnoDB

Select rows for values in one table but no in another
Posted by: Pika Varsh
Date: June 14, 2005 10:12AM

Hi there,

I have 2 tables transactions and dealer. for each record in the transaction tbale (i.e. for each transaction created) there is a dealer_code (dealer_code being the primary key of dealer table where details of all dealers are kept) assigned to it. I want to get a list of all dealers that are in the dealer table but not in the transactions table for the month of June. I have used the following but it doesnt work! Help!


Select dealer.DEALER_CODE, dealer.DEALER
From dealer , transactions
Where month(transactions.TRANSACTION_CREATED) = 6 AND dealer.DEALER_CODE <> transactions.DEALER_CODE


This gives me all the dealers in the dealer table and not those not found in the transactions table.

Options: ReplyQuote


Subject
Views
Written By
Posted
Select rows for values in one table but no in another
7179
June 14, 2005 10:12AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.