Guest User

Untitled

a guest
Jul 19th, 2018
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. CREATE TABLE `users` (
  2. `id` INT(11) NOT NULL AUTO_INCREMENT,
  3. `name` VARCHAR(255) DEFAULT NULL,
  4. `gender` INT(11) NOT NULL COMMENT '0 - не указан, 1 - мужчина, 2 - женщина.',
  5. `birth_date` INT(11) NOT NULL COMMENT 'Дата в unixtime.',
  6. `phone` VARCHAR(255) DEFAULT NULL,
  7. PRIMARY KEY (`id`)
  8. );
  9.  
  10. SELECT name where floor( datediff(curdate(), FROM_UNIXTIME(birth_date))/365 ) > 18 and floor( datediff(curdate(), FROM_UNIXTIME(birth_date))/365 ) < 22 FROM `users`
Add Comment
Please, Sign In to add comment