hallo,
ich bin neuling in sachen sql und hoffe ihr seht mein problem nicht als zu nichtig an, um darauf zu antworten.
ich habe mehrere tabellen:
tabelle 1 "controls" mit controlID, name, typ, etc.
typ ist hier foreign key zur tabelle 2 und verweist dort auf die ID als primery
tabelle 2 "control_typ" mit typID, feldtyp, tabellenname
tabellename enthält den namen der tabelle 3
tabelle 3 "control_ganzzahlfeld" mit ID, default, min-wert, max-wert, schrittweite, etc
jetzt möchte ich gerne alle attribute zum control mit der id=xy abfragen, kenne aber nichts anderes...
wie muss ich jetzt das select statement so verschachteln daß ich am schluß folgendes ergebnis bekomme: (also quasi ein select * from tabelle 3 abhängig vom control ID)
controlID | default | min | max | etc
ich hab schon diverse bücher gewälzt, komme aber einfach nicht auf den trick.
ich hoffe jemand hier kann mir helfen.
gruß
con
ich bin neuling in sachen sql und hoffe ihr seht mein problem nicht als zu nichtig an, um darauf zu antworten.
ich habe mehrere tabellen:
tabelle 1 "controls" mit controlID, name, typ, etc.
typ ist hier foreign key zur tabelle 2 und verweist dort auf die ID als primery
tabelle 2 "control_typ" mit typID, feldtyp, tabellenname
tabellename enthält den namen der tabelle 3
tabelle 3 "control_ganzzahlfeld" mit ID, default, min-wert, max-wert, schrittweite, etc
jetzt möchte ich gerne alle attribute zum control mit der id=xy abfragen, kenne aber nichts anderes...
wie muss ich jetzt das select statement so verschachteln daß ich am schluß folgendes ergebnis bekomme: (also quasi ein select * from tabelle 3 abhängig vom control ID)
controlID | default | min | max | etc
ich hab schon diverse bücher gewälzt, komme aber einfach nicht auf den trick.
ich hoffe jemand hier kann mir helfen.
gruß
con
Comment