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:

  1. lib_issue_id - primary key
  2. book_no - foreign key
  3. member_id - foreign key
  4. issue_date <= system date
  5. issue_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

Popular posts from this blog

c++ - QTextObjectInterface with Qml TextEdit (QQuickTextEdit) -

javascript - angular ng-required radio button not toggling required off in firefox 33, OK in chrome -

xcode - Swift Playground - Files are not readable -