https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21674

--- Comment #9 from Nick Clemens <[email protected]> ---
(In reply to Jonathan Druart from comment #8)
> (In reply to Jonathan Druart from comment #7)
> > Created attachment 97667 [details] [review] [review]
> > Bug 21674: Remove duplicates from library_groups before adding the uniq
> > constraint
> > 
> > To avoid to make it fails if duplicates existed prior to this change
> 
> There is certainly a more efficient (SQL) way to do that.

DELETE FROM library_groups WHERE id NOT IN (SELECT MIN(id) FROM library_groups
WHERE parent_id IS NOT NULL GROUP BY parent_id,branchcode) AND parent_id IS NOT
NULL;

-- 
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[email protected]
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to