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 pocetVyp.pocetVypujcek AS NejvicVypujcek, CTENAR.prijmeniC FROM pocetVyp INNER JOIN CTENAR ON pocetVyp.c_cten = CTENAR.c_cten ORDER BY pocetVyp.pocetVypujcek desc;