annA: Abfrage von Daten mit Primärschlüssel aus Spalte

Beitrag lesen

Hallo Maresa,

wenn Du folgende Tabellen hast:

table a(id int, name varchar(20));
VALUES (1 , 'Mueller');
VALUES (2 , 'Schaefer');

table b(id int, projekt varchar(20));
VALUES (1 , 'HTML');
VALUES (2 , 'PHP');

table c(id_a int, id_b int));
VALUES (1 , 1);
VALUES (1 , 2);

dann probier mal eine anweisung wie diese:
select projekt from a,b,c where b.id=c.id_b and a.name = 'Mueller';
das sollte herauskommen:
+---------+
| projekt |
+---------+
| HTML    |
| PHP     |
+---------+