Generates SQL to transfer duplicate bibliography entries to single entry