Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CREATE TABLE `users` (
- `id` INT(11) NOT NULL AUTO_INCREMENT,
- `name` VARCHAR(255) DEFAULT NULL,
- `gender` INT(11) NOT NULL COMMENT '0 - не указан, 1 - мужчина, 2 - женщина.',
- `birth_date` INT(11) NOT NULL COMMENT 'Дата в unixtime.',
- `phone` VARCHAR(255) DEFAULT NULL,
- PRIMARY KEY (`id`)
- );
- 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