NejvicVypujcek

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

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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;