分段統計函數(年齡分段)

SELECT CASE WHEN YEAR (CURDATE()) - YEAR (birthday) - ( RIGHT (CURDATE(), 5) < RIGHT (birthday, 5) ) <= 10 THEN '[0-10)歲' WHEN YEAR (CURDATE()) - YEAR (birthday) - ( RIGHT (CURDATE(), 5) < RIGHT (
相關文章
相關標籤/搜索