lee leeson - 2009-10-06

Hallo,
erstmal super geodb, ich habe dazu eine frag ich habe versucht die neue Db von fa-technik.adfc.de in das 'alte' Fromat zu bringen, dies war kein Problem. Leider habe ich dabei festgestellt daß die hier.sql nicht korrekt ist. Dann habe ich versucht die hier selbst zu erstellen. Leider bin ich da immer gegen eine Wand gelaufen mit joins konnte ich zwar alles anzeigen aber auch nuller werte

SELECT t1.text_val AS lev1, t2.text_val as lev2, t3.text_val as lev3, t4.text_val as lev4, t5.text_val as lev5, t6.text_val as lev6, t7.text_val as lev7, t8.text_val as lev8, t9.text_val as lev9 FROM geodb_textdata as t1
LEFT JOIN geodb_textdata AS t2 ON t2.loc_id = t1.text_val
LEFT JOIN geodb_textdata AS t3 ON t3.loc_id = t2.text_val
LEFT JOIN geodb_textdata AS t4 ON t4.loc_id = t3.text_val
LEFT JOIN geodb_textdata AS t5 ON t5.loc_id = t4.text_val
LEFT JOIN geodb_textdata AS t6 ON t6.loc_id = t5.text_val
LEFT JOIN geodb_textdata AS t7 ON t7.loc_id = t6.text_val
LEFT JOIN geodb_textdata AS t8 ON t8.loc_id = t7.text_val
LEFT JOIN geodb_textdata AS t9 ON t9.loc_id = t8.text_val

WHERE t1.loc_id = '1'
AND t1.text_type='400100000'
AND t2.text_type='400100000'
AND t3.text_type='400100000'
AND t4.text_type='400100000'
AND t5.text_type='400100000'
AND t6.text_type='400100000'
AND t7.text_type='400100000'
AND t8.text_type='400100000'
AND t9.text_type='400100000'

liefert nichts da europa kein 40010000 ist

SELECT t1.text_val AS lev1, t2.text_val as lev2, t3.text_val as lev3, t4.text_val as lev4, t5.text_val as lev5, t6.text_val as lev6, t7.text_val as lev7, t8.text_val as lev8, t9.text_val as lev9 FROM geodb_textdata as t1
LEFT JOIN geodb_textdata AS t2 ON t2.loc_id = t1.text_val
LEFT JOIN geodb_textdata AS t3 ON t3.loc_id = t2.text_val
LEFT JOIN geodb_textdata AS t4 ON t4.loc_id = t3.text_val
LEFT JOIN geodb_textdata AS t5 ON t5.loc_id = t4.text_val
LEFT JOIN geodb_textdata AS t6 ON t6.loc_id = t5.text_val
LEFT JOIN geodb_textdata AS t7 ON t7.loc_id = t6.text_val
LEFT JOIN geodb_textdata AS t8 ON t8.loc_id = t7.text_val
LEFT JOIN geodb_textdata AS t9 ON t9.loc_id = t8.text_val

WHERE t1.loc_id = '1'
AND t1.text_type='400100000'
AND t2.text_type='400100000'
AND t3.text_type='400100000'
AND t4.text_type='400100000'
AND t5.text_type='400100000'
AND t6.text_type='400100000'

bringt was hat jemand ein script um die hierachie zu erstellen.?

danke