EKKi: 2 Select abfragen aus der selben Tabelle in eine zusammenfassen

Beitrag lesen

Mahlzeit gast 1000,

LEFT JOIN  geodb_textdata b ON  b.loc_id=21248 AND b.text_type=500100000

SELF-JOINs mit fixen Werten sind bei so einem Anwendungsfall ziemlicher Bockmist.

SELECT a.text_val AS Plz  
,      b.text_val AS Ort  
  FROM geodb_textdata      a  
  LEFT JOIN geodb_textdata b ON (a.loc_id = b.loc_id AND b.text_type = 500100000)  
 WHERE a.loc_id = 21248  
   AND a.text_type = 500400000

MfG,
EKKi

--
sh:( fo:| ch:? rl:( br:> n4:~ ie:% mo:} va:) de:] zu:) fl:{ ss:) ls:& js:|