h1

Agregari(MIN,MAX,AVG,COUNT)

November 10, 2009

Exemplu functia agregat MIN, MAX si AVG

Fie tabela cu urmatoarele 2 campuri

id                                         Pret
00394                              45,69
00394                              35
00394                              35

00394                              44,3

00395                              46,63

00395                             41
00395                             41
00395                            45,45

Recuperarea pretului minim per id (unde id e unic):

min

Pentru functiile maxim si medie aritmetica vom folosi functiile agregat MAX respectiv AVG astfel:

avgmax

 

Exemplu functia agregat COUNT pt.numararea inregistrarilor dintr-o coloana:

 

count

 

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: