Koha Croatian user group
Brisanje biblio zapisa bez primjeraka: Revision 2

Skripta

scrub_orphaned_biblios.pl

ne radi!

može i ovako:

mysql> SELECT biblio.biblionumber, biblioitems.itemtype, items.biblionumber as items_biblionumber from biblio RIGHT JOIN biblioitems ON biblio.biblionumber = biblioitems.biblionumber LEFT JOIN items ON biblio.biblionumber = items.biblionumber WHERE items.biblionumber IS NULL ;
mysql> begin ;
mysql> delete biblio.* from biblio LEFT JOIN items ON biblio.biblionumber = items.biblionumber WHERE items.biblionumber IS NULL ;

mysql> commit;