https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40057 Jonathan Druart <jonathan.druart@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart@gmail.com --- Comment #11 from Jonathan Druart <jonathan.druart@gmail.com> --- (In reply to Marcel de Rooy from comment #9)
Just curious SELECT COUNT(*) FROM illrequests WHERE borrowernumber NOT IN (SELECT borrowernumber FROM borrowers) UPDATE illrequests SET borrowernumber = NULL WHERE borrowernumber NOT IN (SELECT borrowernumber FROM borrowers) Wouldnt a join on borrowers with a NULL test be better? No big deal.
I came here to say that. This is really not the best we can do. The following query using LEFT JOIN should work: UPDATE illrequests AS ill LEFT JOIN borrowers AS b ON ill.borrowernumber = b.borrowernumber SET ill.borrowernumber = NULL WHERE b.borrowernumber IS NULL; -- You are receiving this mail because: You are watching all bug changes.