NejvicVypujcek
From Wikivyuka
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;