Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- mysql> SELECT id, email, birthday, birthmonth, birthyear, str_to_date(concat(birthmonth,"/",birthday,"/",birthyear), '%m/%d/%Y') AS birthdate FROM users HAVING birthyear != 0 and birthdate > str_to_date('00/00/1990','%m/%d/%Y');
- +----+-------+----------+------------+-----------+------------+
- | id | email | birthday | birthmonth | birthyear | birthdate |
- +----+-------+----------+------------+-----------+------------+
- +----+-------+----------+------------+-----------+------------+
- 1 row in set (0.01 sec)
- mysql> SELECT id, email, birthday, birthmonth, birthyear, str_to_date(concat(birthmonth,"/",birthday,"/",birthyear), '%m/%d/%Y') AS birthdate FROM users HAVING birthyear != 0 and birthdate < str_to_date('00/00/1990','%m/%d/%Y');
- +----+---------------------+----------+------------+-----------+------------+
- | id | email | birthday | birthmonth | birthyear | birthdate |
- +----+---------------------+----------+------------+-----------+------------+
- +----+---------------------+----------+------------+-----------+------------+
- 3 rows in set (0.00 sec)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement