Juergen: Abfrage OpenGeoDB, postleitzahlen groupieren?

Beitrag lesen

SELECT 
->>>>>>>>> plz.text_val AS plz,
gtv.loc_id, name.text_val AS name, typ.text_val AS typ
FROM geodb_textdata gtv
LEFT JOIN geodb_textdata name ON gtv.loc_id = name.loc_id
LEFT JOIN geodb_textdata typ ON gtv.loc_id = typ.loc_id
->>>>>>> LEFT JOIN geodb_textdata plz ON gtv.loc_id = plz.loc_id
WHERE name.text_type = 500100000 /* Name */
AND plz.text_type = 500300000 /* Postleitzahl */
AND typ.text_type = 400300000 /* Typ */
AND gtv.text_type = 400100000 /* Teil von */
AND gtv.text_val = '77690 ' /* loc_id des Bezirkes */;

Also die beiden müssen raus

Dann schreibst du ein separates Statement

Bei WHERE?