http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9351 --- Comment #32 from David Cook <dcook@prosentient.com.au> --- I just tried out the following: UPDATE statistics SET itemtype = (select u.itype from (select itype,itemnumber from items UNION ALL select itype,itemnumber from deleteditems ) u where statistics.itemnumber = u.itemnumber ) WHERE type IN ('localuse', 'return') This will re-write the "itemtype" for all 'localuse' and 'return' existing statistical entries. I checked its accuracy with the following: SELECT statistics.*, u.itype from statistics JOIN ( select * from items UNION ALL select * from deleteditems ) u ON u.itemnumber = statistics.itemnumber WHERE type IN ('localuse', 'return') order by datetime ; Looks all right to me. -- You are receiving this mail because: You are watching all bug changes.