SELECT [DISTINCT] grp_stolpec, SUM(stolpec), COUNT([* | [DISTINCT] stolpec]), ...
FROM tabela
WHERE stolpec [> | < | >= | <= | = | <>] [ALL | ANY] (
SELECT ...
) AND stolpec IS [NOT] NULL
GROUP BY grp_stolpec
HAVING pogoj
SELECT
Naloga | DA | DB | MČ | AG | HKK | LM | MO | SO | MP | TP | PR | TS | LŠ | AT |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
6 | x | X | x | X | X | X | X | X | X | X | X | X | X | X |
7 | x | X | x | X | X | X | X | X | X | X | X | X | X | X |
8 | x | X | x | X | X | X | X | X | X | X | X | X | X | X |
9 | x | X | x | X | X | X | X | X | X | X | X | X | X | X |
10 | x | X | x | X | X | X | X | x | X | X | X | X | X | X |
SUM
in COUNT
Naloga | DA | DB | MČ | AG | HKK | LM | MO | SO | MP | TP | PR | TS | LŠ | AT |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | x | X | x | X | X | X | X | X | X | X | X | X | X | X |
2 | x | X | x | X | X | X | X | X | X | X | X | X | X | X |
3 | x | X | x | X | X | X | X | X | X | X | X | X | X | X |
4 | x | X | x | X | X | X | X | X | X | X | X | X | X | X |
5 | x | X | x | X | X | X | X | X | X | X | X | X | X | X |
6 | x | X | x | X | X | X | X | X | X | X | X | X | X | X |
7 | x | X | x | X | X | X | X | X | X | X | X | X | X | X |
8 | x | X | x | X | X | X | X | X | X | X | X | X | X | X |
nobel
Naloga | DA | DB | MČ | AG | HKK | LM | MO | SO | MP | TP | PR | TS | LŠ | AT |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | x | X | x | X | X | X | X | X | X | X | X | X | X | X |
2 | x | X | x | X | X | X | X | X | X | X | X | X | X | X |
3 | x | X | x | X | X | X | X | X | X | X | X | X | X | X |
4 | x | X | x | X | X | X | X | X | X | X | X | X | X | X |
5 | x | X | x | X | X | X | X | X | X | X | X | X | X | X |
6 | x | X | x | X | X | X | X | X | X | X | X | X | X | X |
7 | x | X | x | X | X | X | X | X | X | X | X | X | X | |
8 | x | X | x | X | X | X | X | X | X | X | X | X | X | |
10 | x | X | x | X | X | x | X | X | X | X | X | X | X | X |
11 | x | X | x | X | X | x | X | X | X | X | X | X | X | X |
12 | x | X | x | X | X | X | X | X | X | X | X | X | X | X |