All pastes #978336 Raw Edit

Vermischtes

public text v1 · immutable
·published 2008-04-09 14:12 UTC
rendered paste body
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