SELECT * FROM `users`
WHERE `ip` IN (select `ip` FROM `users_base` WHERE `user_id` = 'blahblahblah');
create table `user_tmp` (ip VARCHAR(32));
insert INTO `user_tmp` (select `ip` from `users` WHERE `user_id` = 'blahblahblah');
select * from `users` WHERE `ip` IN (select `ip` FROM `user_tmp`);