Hey Leute,
ich weiß einfach nicht warum er mir den Fehler bringt -.-
Vll. kann mir ja jemand von euch helfen...
CREATE VIEW Liebling AS
SELECT C.first_name AS Kunden_Vorname, C.last_name AS Kunden_Nachname,
A.first_name AS Actor_Vorname, A.last_name AS Actor_Nachname, A.actor_id, count(FA.film_id) AS Anzahl_der_Filme
FROM Customer C, Rental R, Inventory I,Film_Actor FA, Actor A
WHERE C.customer_id = R.customer_id
AND R.inventory_id = I.inventory_id
AND I.film_id = FA.film_id
AND FA.actor_id = A.actor_id
GROUP BY C.first_name, C.last_name,A.first_name, A.last_name, A.actor_id
ORDER BY C.first_name, C.last_name, A.actor_id;
SELECT T.Kunden_Vorname, T.Kunden_Nachname, T.Actor_Vorname, T.Actor_Nachname, T.actor_id, T.Anzahl_der_Filme
FROM Liebling T
JOIN (SELECT Kunden_Vorname, Kunden_Nachname, MAX(Anzahl_der_Filme) AS Maximale_Anzahl
FROM Liebling
GROUP BY Kunden_Vorname, Kunden_Nachname) X
ON T.Kunden_Vorname = X.Kunden_Vorname
AND T.Kunden_Nachname = X.Kunden_Nachname
AND T.Anzahl_der_Filme = X.Maximale_Anzahl;
ich weiß einfach nicht warum er mir den Fehler bringt -.-
Vll. kann mir ja jemand von euch helfen...
CREATE VIEW Liebling AS
SELECT C.first_name AS Kunden_Vorname, C.last_name AS Kunden_Nachname,
A.first_name AS Actor_Vorname, A.last_name AS Actor_Nachname, A.actor_id, count(FA.film_id) AS Anzahl_der_Filme
FROM Customer C, Rental R, Inventory I,Film_Actor FA, Actor A
WHERE C.customer_id = R.customer_id
AND R.inventory_id = I.inventory_id
AND I.film_id = FA.film_id
AND FA.actor_id = A.actor_id
GROUP BY C.first_name, C.last_name,A.first_name, A.last_name, A.actor_id
ORDER BY C.first_name, C.last_name, A.actor_id;
SELECT T.Kunden_Vorname, T.Kunden_Nachname, T.Actor_Vorname, T.Actor_Nachname, T.actor_id, T.Anzahl_der_Filme
FROM Liebling T
JOIN (SELECT Kunden_Vorname, Kunden_Nachname, MAX(Anzahl_der_Filme) AS Maximale_Anzahl
FROM Liebling
GROUP BY Kunden_Vorname, Kunden_Nachname) X
ON T.Kunden_Vorname = X.Kunden_Vorname
AND T.Kunden_Nachname = X.Kunden_Nachname
AND T.Anzahl_der_Filme = X.Maximale_Anzahl;