ÇØÇÇCGI ÀÔ´Ï´Ù.
ÀÚÁÖ ¾²´Â ¹®±¸Àε¥ °¡²û ±î¸Ô´Â°æ¿ì°¡ ¸¹¾Æ¼ ¸Þ¸ð°â ¿Ã·Áº¾´Ï´Ù.
[ÇÁ·Î±×·¥ÄÚµå]
SELECT DATE_SUB( curdate(), INTERVAL 1 month ) |
curdate() ´ë½Å ¿øÇÏ´Â ³¯Â¥¸¦ ³Ö°Ô µÇ¸é Çش糯¥ÀÇ Àü´ÞÀ» ¾Ë¼ö ÀÖ°ÚÁÒ?
¶ÇÇϳªÀÇ ÆÁ (À̰͵µ ¸Þ¸ð°â -.-);;
[ÇÁ·Î±×·¥ÄÚµå]SELECT left(DATE_SUB( curdate(), INTERVAL 1 month ) ,7) |
ÀÌ·¸°Ô ¾´´Ù¸é ÇØ´çÀÌÀü´ÞÀÇ ³âµµ¿Í ¿ù¸¸ »©³¾¼ö ÀÖ°ÚÁÒ?
¶Ç¶Ç ÇϳªÀÇ ÆÁ
¸¸¾à reg_date ¶ó´Â Çʵ尡 ³¯Â¥Çʵå¶ó°í °¡Á¤À» ÇÏ°í
[ÇÁ·Î±×·¥ÄÚµå]SELECT * from Å×À̺í¸í where left(DATE_SUB( curdate(), INTERVAL 1 month ) ,7) = left(reg_date,7) |
ÀÌ·¸°Ô »ðÁúÀ» Çغ¼¼öµµ ÀÖ°Ú±º¿ä ^^
sql·Î Çѹø¿¡ ŸÀÓ°¸À» ±¸ÇØ¾ß ÇÏ´Â °æ¿ì
[ÇÁ·Î±×·¥ÄÚµå]
select *,(TO_DAYS(curdate())-TO_DAYS(³¯Â¥Ä÷³)) as gap from Å×À̺í¸í |
·Î »ç¿ëÇÒ¼ö ÀÖ´ä´Ï´Ù.
°°ÀºÇØ ÀÌÀü´ÞÀÇ ¸ðµç Á¤º¸¸¦ ¾î¶»°Ô Çغ¼·Á°í ÇÒ¶§ ÁÁ°ÚÁÒ?
Ãß°¡¸Þ¸ð ^^ (2007.04.25)
ÇöÀç½Ã°£¿¡¼ ¼¼½Ã°£Àü º¸±â.
[ÇÁ·Î±×·¥ÄÚµå]
SELECT DATE_SUB( now(), INTERVAL 3 HOUR ) |