SELECT
member_id,
(DATE_FORMAT(NOW(), '%Y%m%d')-DATE_FORMAT(member_birth, '%Y%m% d'))/10000 age
FROM member_table
WHERE
(DATE_FORMAT(NOW(), '%Y%m%d')-DATE_FORMAT(member_birth
, '%Y%m%d'))/10000 <= 30 AND (DATE_FORMAT(NOW(), '%Y%m%d')-DATE_FORMAT(member_birth , '%Y%m%d'))/10000 >= 20
0 件のコメント:
コメントを投稿