NejvicVypujcek

From Wikivyuka
Revision as of 06:24, 22 November 2011 by Dur30 (talk | contribs)

Jump to: navigation, search
SELECT Count(id_ex) AS pocetVypujcek, c_cten
FROM VYPUJCKA AS v
GROUP BY c_cten;

Tento dotaz ulozime pod nazvem pocetVyp a pouzijeme jej jako vstup do dalsiho dotazu:

SELECT TOP 1 Max(pocetVyp.pocetVypujcek) AS MaxOfpocetVypujcek, CTENAR.prijmeniC
FROM pocetVyp INNER JOIN CTENAR ON pocetVyp.c_cten = CTENAR.c_cten
GROUP BY pocetVyp.c.c_cten, pocetVyp.pocetVypujcek, CTENAR.prijmeniC
ORDER BY pocetVyp.pocetVypujcek desc;

Zpět na stránku DBS - cvičení