MySQL 4.1 ãªãã¡ã¬ã³ã¹ããã¥ã¢ã« ã® ãæ¥ä»ã¨æå»é¢æ°ãã«ã¯ã ãã®ã¯ã¨ãªã§ã¯ãéå» 30 æ¥ä»¥å ã®æ¥ä»ã® date_col å¤ãæã¤ãã¹ã¦ã®ã¬ã³ã¼ããé¸æããã¾ã ã¨ã㦠SELECT something FROM tbl_name WHERE TO_DAYS(NOW()) - TO_DAYS(date_col) >= 30; ã¨ãã SQL æãç´¹ä»ããã¦ããããã©ããããã£ã¦ INDEX ã使ãããªãããã§ã 30æ¥åã®æ¥ä»ãä»ã§åãããªããããã BETWEEN ã§æå®ãã¦ãããã°ãtype ã range ãªã¤ã³ããã¯ã¹ã使ããããã ããããã¨ãã° SELECT something FROM tbl_name WHERE date_col BETWEEN DATE_FORMAT(DATE_ADD(NOW(), INTERVAL -30 DAY), '%Y-%m-%d 0
{{#tags}}- {{label}}
{{/tags}}