正在加载图片...
Group by Find the number of accounts for each branch select branch-name count(account-number) from account group by branch-name For each group of tuples with the same branch-name, apply aggregate function count and distinct to account-number branch-name account-number balance branch-name account-number balance Perryridge a-102 400 Perryridge a-102 400 Brighte a-217 750 Perryridge 900 Perryridge a-201 900 Brighton -217 750 Brighton a-215 750 Brighton gn a-215 750 Redwood a-222 700 Redwood 700 branch-name count-account-no account table Perryridge Brighton 2 Redwood COMP3311 Fall 2011 CSE, HKUST Slide 14COMP3311 Fall 2011 CSE, HKUST Slide 14 Group by • Find the number of accounts for each branch. select branch-name, count(account-number) from account group by branch-name • For each group of tuples with the same branch-name, apply aggregate function count and distinct to account-number branch-name count-account-no Perryridge Brighton Redwood 2 2 1 branch-name account-number balance Perryridge Brighton Perryridge Brighton Redwood a-102 a-217 a-201 a-215 a-222 400 750 900 750 700 branch-name account-number balance Perryridge Perryridge Brighton Brighton Redwood a-102 a-201 a-217 a-215 a-222 400 900 750 750 700 account table
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有