I have 2 tables 'Open' and 'Close' with this structure: mysql> describe Open; +-------+---------------------+------+-----+----------+-------+ | Field | Type | Null | Key | Default | Extra | +-------+---------------------+------+-----+----------+-------+ | ID | int(10) unsigned | | | 0 | | | Day | tinyint(3) unsigned | YES | | 0 | | | Open | time | YES | | 00:00:00 | | +-------+---------------------+------+-----+----------+-------+ mysql> describe Close; +-------+---------------------+------+-----+----------+-------+ | Field | Type | Null | Key | Default | Extra | +-------+---------------------+------+-----+----------+-------+ | ID | int(10) unsigned | | | 0 | | | Day | tinyint(3) unsigned | YES | | 0 | | | Close | time | YES | | 00:00:00 | | +-------+---------------------+------+-----+----------+-------+
They hold opening and closing times for bookstores. Day = [0..6] ID is the bookstore ID.
A typical set of entries would look like this; mysql> select * from Open where ID=2; +------+------+----------+ | ID | Day | Open | +------+------+----------+ | 2 | 0 | 00:00:00 | | 2 | 1 | 08:00:00 | | 2 | 2 | 08:00:00 | | 2 | 3 | 08:00:00 | | 2 | 4 | 08:00:00 | | 2 | 5 | 08:00:00 | | 2 | 6 | 08:00:00 | +------+------+----------+
mysql> select * from Close where ID=2; +------+------+----------+ | ID | Day | Close | +------+------+----------+ | 2 | 0 | 00:00:00 | | 2 | 1 | 17:00:00 | | 2 | 2 | 17:00:00 | | 2 | 3 | 17:00:00 | | 2 | 4 | 17:00:00 | | 2 | 5 | 17:00:00 | | 2 | 6 | 17:00:00 | +------+------+----------+
Both tables should hold the same number of records.
However, I've discovered that 'Close' is one less than 'Open' (1693 vs 1694).
How can I find out which record is missing from 'Close'? I know it's not the case of an extra entry in 'Open' because 1694 divides evenly by 7, whereas 1693 doesn't.
--
Amer Neely, Softouch Information Services
-- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]