INSERT INTO bookrentallist(isbn, booktitle, id, name, email, rentaldate, duedate)
VALUES(#{isbn}, #{booktitle}, #{id}, #{name}, #{email}, now(), (SELECT DATE_ADD(NOW(), interval 7 day))
½ºÇÁ¸µºÎÆ®·Î µµ¼°ü¸®»çÀÌÆ® ±¸ÇöÁßÀÔ´Ï´Ù.
duedate¿¡ ÇöÀ糯¥ +7ÀÏÇÑ ³¯Â¥¸¦ insert Çؼ ºä´Ü¿¡ »Ñ¸®·ÁÇϴµ¥
ÀÀ¿ëÀ» ¸øÇÏ°Ú¾î¿ä ¤Ð¤Ð µµ¿ÍÁÖ¼¼¿ä!!!! (_ _)
|
¾î·Æ°Ô »ý°¢ÇÏ½Ç ÇÊ¿ä ¾ø½À´Ï´Ù. now()¸¦ ÇϳªÀÇ ÇÔ¼ö·Î ÀÚ¿¬½º·´°Ô ¾²½ÃµíÀÌ date_add()µµ ÇϳªÀÇ ÇÔ¼öÀ̹ǷΠselect¸¦ ºÙÀÌÁö ¾Ê°í »ç¿ëÇÏ½Ã¸é µË´Ï´Ù.
now(), date_add(now(), interval 7 day));
´Ù½Ã Çغ¸´Ï±ñ µÇ³×¿ä ¤Ð¤Ð °¨ÀðÇÕ´Ï´Ù~~~!!!!