Execute this:
SELECT g.guild_id, g.char_id, c.char_id, c.last_login FROM guild_members g LEFT JOIN `char` c ON c.char_id = g.char_id;
There might be some guild for which char_id is not found in char table.
You would get guild Id where 3rd and 4th column might be NULL, 2nd column is the char id that does not exist in char table (deleted or something?)