Autor Beitrag
Shaky
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 72

WinXP
D5, Delphi 2005 Prof.
BeitragVerfasst: So 05.06.05 11:01 
Hi. Kann mir jemand helfen ich bin zu blöd.

Hab 2 Tabellen

Album
text : Varchar;
o : integer; (Ordner der Galeie)
id : integer; (Bildnummer in der Galerie)

Album_seen
o: integer;
id: integer;
user_id: integer;

ich möchte jetzt alle Einträge aus Album haben bei die nicht in album seen drin stehen.
Will halt ne liste ausgeben wo man sieht neuer kommentar zu bild dingsda.
Und sobald man die seite dann geöffnet hat wird in album seen die auto_id des bild gesetzt mit der entsprechenden user_id.
Sobald dann ein neue kommentar kommt werden alle aus album_seen gelöscht die den o und die id haben.

Verstanden?

Ich brauche also nur die inner join select Abfrage welche bild ich noch sehen muss.
Danke
alzaimar
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2889
Erhaltene Danke: 13

W2000, XP
D6E, BDS2006A, DevExpress
BeitragVerfasst: So 05.06.05 11:34 
Ich kanns nur mit MSSQL:
ausblenden Quelltext
1:
2:
select * from album left join album_seen on album.id = album_seen.id
where album_seen.id is null
Zeige alles aus album, was nicht in album_seen ist. Andersrum mit right join und abfrage auf album.id

ausblenden Quelltext
1:
2:
select * from album right join album_seen on album.id = album_seen.id
where album.id is null