
INSERT INTO wb_gl VALUES
(1, 'Matzner Hügel'),
(2, 'Wolkersdorfer Hochleiten'),
(3, 'Falkensteiner Hügelland');

INSERT INTO wb_kg
SELECT k.kgnr, 1
FROM wb_gem wg
    LEFT JOIN AT_gem g ON g.gkz = wg.gkz
    LEFT JOIN AT_kg k ON k.gkz = g.gkz
WHERE hkid = 'WLWV' AND g.gkz / 100 IN (308, 316) AND k.name IN
    ('Angern', 'Großschweinbarth', 'Mannersdorf', 'Prottes', 'Stillfried', 'Grub an der March', 'Auersthal', 'Dörfles',
     'Ebenthal', 'Hohenruppersdorf', 'Kleinharras', 'Kollnbrunn', 'Matzen', 'Ollersdorf', 'Pirawarth', 'Raggendorf',
     'Reyersdorf', 'Schönkirchen', 'Spannberg', 'Stripfing', 'Tallesbrunn', 'Götzendorf', 'Velm', 'Waidendorf',
     'Dürnkrut', 'Baumgarten an der March', 'Gänserndorf', 'Weikendorf');

INSERT INTO wb_kg
SELECT k.kgnr, 2
FROM wb_gem wg
    LEFT JOIN AT_gem g ON g.gkz = wg.gkz
    LEFT JOIN AT_kg k ON k.gkz = g.gkz
WHERE hkid = 'WLWV' AND g.gkz / 100 IN (308, 316) AND k.name IN
    ('Bockfließ', 'Großengersdorf', 'Wolkersdorf', 'Pillichsdorf');

INSERT INTO wb_kg
SELECT k.kgnr, 3
FROM wb_gem wg
    LEFT JOIN AT_gem g ON g.gkz = wg.gkz
    LEFT JOIN AT_kg k ON k.gkz = g.gkz
WHERE hkid = 'WLWV' AND g.gkz / 100 IN (308, 316) AND k.name IN
    ('Erdpreß', 'Martinsdorf', 'Niedersulz', 'Obersulz', 'Großinzersdorf', 'Palterndorf', 'Gaweinstal', 'Zistersdorf');
