CREATE TABLE `vcserver_development`.`users` ( `id` int(11) NOT NULL auto_increment, ... PRIMARY KEY (`id`), ) ENGINE=InnoDB DEFAULT CHARSET=latin1; CREATE TABLE `vcserver_development`.`invitations` ( `id` int(11) NOT NULL auto_increment, `user_id` int(50) default NULL, ... `created_at` datetime default NULL, PRIMARY KEY (`id`), ) ENGINE=InnoDB DEFAULT CHARSET=latin1; I want to get all users that do not have invitations from the last 24 hours. SELECT vcserver_development.users.id FROM `vcserver_development`.`users` LEFT JOIN `vcserver_development`.`invitations` ON (vcserver_development.users.id=vcserver_development.invitations.user_id) WHERE vcserver_development.invitations.user_id IS NULL