Created
March 12, 2013 22:31
-
-
Save srockstyle/5147700 to your computer and use it in GitHub Desktop.
一定期間内のデータを抽出するには以下のSQL。二番目はRailsのcreated_atの場合引っ張ってきたいものを指定したりするのに使う。
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT id from table_name where date>=ADDDATE(CURDATE(),Interval -7 DAY) | |
SELECT `recruits`.* FROM `recruits` WHERE (keisai_flag = '1' and date_add(current_date, interval -3 day) <= created_at ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment