Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- INSERT INTO `player_history` (`player_id`, `date`, `races`, `maps`, `playtime`, `points`)
- SELECT `p`.`id`, DATE_SUB(NOW(), INTERVAL 1 DAY), `p`.`races`, `p`.`maps`, `p`.`playtime`, `p`.`points`
- FROM `player` `p`
- WHERE `p`.`playtime` IS NOT NULL
- AND `p`.`playtime` > 0
- AND (SELECT `player_id`
- FROM `player_history`
- WHERE (`player_id` = `p`.`id`
- AND `date` < NOW())
- OR( `playtime` = `p`.`playtime`
- AND `races` = `p`.`races`
- AND `points` = `p`.`points`
- AND `maps` = `p`.`maps`)
- ORDER BY `date` DESC
- LIMIT 1) IS NULL
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement