h1

Cap4. Interogari, expresii si functii agregat

March 16, 2010

1) Clauza SELECT

CROSS JOIN pt.2 tabele in mssql:

Ex2: Clauza SELECT

Ex3: Afisare coloane si valori calculate (clauza select):

Ex4: Selectarea randurilor bazate pe valoarea coloanelor

Ex5: Clauza SELECT si WHERE pt.o valoare calculata

Ex6: Selectare coloane, sau coloana calculata folosind

predicate si operatori:

Ex7: Folosirea operatorilor OR,AND si NOT intr-o clauza

WHERE:

Ex8: Clauza ORDER BY in clauza SELECT:

Ex9: Operatori AND,OR, NOT (operatori logici) si operatori

relationali:

Ex10: Subcereri: (sintaxa generala):

Exemplul1:

Exemplul2:

Exemplul3:

Ex1: Expresii:

Clauza DECLARE definire variabila locala si ultimul exemplu cautare cu like functie de variabila definita local:

Efect:

Ex11: Clauza DELETE cu op.logici si relationali:

Ex12: Functii agregat:

Ex13: Functiile COALESCE( e similara cu functia ISNULL), NULLIF

Ex14: Operatorii AND,OR si NOT exemple: (pt.conditii multiple ale inregistrarilor dintr-o tabela)

Ex15: GROUP BY cu clauze ROLLUP si CUBE (pt.subtotals si grand totals):

Ex16: Functia agregata COUNT:

Ex17: Functiile agregate MAX si MIN:

Ex18: Functia agregata SUM:

Ex19: Functia agregata AVG:

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: