query of two tables returns too many rows, many more than the two tables contain

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I have two tables I want to get out the rows that are different between 
them. The results I am getting is almost 50,000 rows, but the two tables, 
combined, contain only about 600 rows total. Here is the select statement 
-

SELECT dealers.account_no, dealers.DealerName, blackgate_users.User_Name, 
blackgate_users.DealerName
FROM dealers, blackgate_users
WHERE dealers.account_no NOT 
LIKE blackgate_users.User_Name

in these tables the 
dealers.account_no is the same data as the blackgate_users.User_Name
dealers.DealerName is the same data as the blackgate_users.DealerName
I just want the rows that are in the dealers table but not in the 
blackgate_users table. 

Thanks for any help,
Chip Wiegand
Computer Services
Simrad, Inc
425-778-8821 
425-771-7211 (FAX)

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux