Tuesday 15 June 2010

SQL SELECT, GROUP BY -



SQL SELECT, GROUP BY -

why have grouping selected columns in grouping if started grouping 1 column?

for instance, why can't have 2 groups? below:

select a, b, c, d mytb groub a, b

you can grouping many elements want. create sure non-grouped elements in select have aggregation.

select a, b, sum(c), max(d) mytb grouping a, b

see

basic info: http://www.techonthenet.com/sql/group_by.php grouping more 1 column: http://www.w3schools.com/sql/trysql.asp?filename=trysql_select_groupby_2

sql

No comments:

Post a Comment