On 12.12.2010 01:27, John May wrote:

>> SELECT COUNT(*) FROM identities WHERE user_id NOT IN (SELECT user_id
>> FROM users);
> 
> 1
> 
>> SELECT COUNT(*) FROM contacts WHERE user_id NOT IN (SELECT user_id
>> FROM users);
> 
> 56

So, you have some records that shouldn't be there. You can delete them with

DELETE FROM identities WHERE user_id NOT IN (SELECT user_id FROM users);
DELETE FROM contacts WHERE user_id NOT IN (SELECT user_id FROM users);

-- 
Aleksander 'A.L.E.C' Machniak
LAN Management System Developer [http://lms.org.pl]
Roundcube Webmail Developer  [http://roundcube.net]
---------------------------------------------------
PGP: 19359DC1 @@ GG: 2275252 @@ WWW: http://alec.pl
_______________________________________________
List info: http://lists.roundcube.net/users/
BT/8f4f07cd

Reply via email to