Неверный запрос select v.id, v.name, va.idaddress ia FROM vendors v, vendors_address va WHERE va.idvendor=v.id AND va.idaddress IN () ORDER BY v.name