mysql - Update two Rows of one column in one table -
lib_issue_id book no member id issue date return date ------------ ------- --------- ---------- ----------- 7001 101 1 10-dec-06 null 7002 102 2 25-dec-06 null 7003 104 1 15-jan-06 null 7004 101 1 04-jul-06 null 7005 104 2 15-nov-06 null 7006 101 3 18-feb-06 null
i have table following constraint:
lib_issue_id
- primary keybook_no
- foreign keymember_id
- foreign keyissue_date <=
system dateissue_date < return_date
how can modify return_date
of 7004
, 7005
15 days after issue_date
?
you can use in or or in update:
update [tablename] set return_date = issue_date + 15 lib_issue_id in (7004, 7005);
Comments
Post a Comment