ALTER TABLE buchungsgruppen ADD COLUMN sortkey integer;
CREATE SEQUENCE tmp_counter;
UPDATE buchungsgruppen SET sortkey = nextval('tmp_counter');
ALTER TABLE buchungsgruppen ADD COLUMN sortkey integer;
CREATE SEQUENCE tmp_counter;
UPDATE buchungsgruppen SET sortkey = nextval('tmp_counter');