Autor Beitrag
D. Annies
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 1843

windows 7
D6 Enterprise, D7 Pers und TD 2006
BeitragVerfasst: Mi 05.07.06 22:08 
Hi, Delpher,

ich habe eine Tabelle, in der Schüler aus mehreren Klassen verschiedene Bücher ausgeliehen haben. Gibt es einen Select-Befehl, der mir die Anzahl der ausgeliehenen Bücher - egal welcher Titel - pro Klasse liefert, oder muss ich mit einem Parameter arbeiten?

Danke für Hilfe, sagt
Detlef Annies
mkinzler
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 4106
Erhaltene Danke: 13


Delphi 2010 Pro; Delphi.Prism 2011 pro
BeitragVerfasst: Mi 05.07.06 22:11 
Ich kenne die struktur der datenbank nicht, aber grundsätzlich ist dies über eine Gruppierung mit Aggregatfunktion möglich.

_________________
Markus Kinzler.
D. Annies Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 1843

windows 7
D6 Enterprise, D7 Pers und TD 2006
BeitragVerfasst: Do 06.07.06 06:44 
Hi, Markus,

die Tabelle hat den Aufbau:

Titel Klasse Name Vorname A_Datum R_Datum

Für jedes Buch gibt es einen Datensatz, das Buch kann ausgeliehen sein, oder nicht.
(Ausleihdatum, Rüchgabedatum). Wenn A_Datum belegt ist, ist das Buch ausgeliehen.

Kannst du jettz besser helfen?

(Select, count(*), group by, order by Klasse ???

Danke, Detlef
UGrohne
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Veteran
Beiträge: 5502
Erhaltene Danke: 220

Windows 8 , Server 2012
D7 Pro, VS.NET 2012 (C#)
BeitragVerfasst: Do 06.07.06 06:47 
ausblenden SQL-Anweisung
1:
SELECT count(*), klasse FROM buecher GROUP BY klasse;					

Sowas in der Art?
D. Annies Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 1843

windows 7
D6 Enterprise, D7 Pers und TD 2006
BeitragVerfasst: Do 06.07.06 08:45 
Hi, Uwe!

Volltreffer!!

Danke,
Detlef Annies