-2

我试图弄清楚如何编写一个计算多列值的查询

Uniform  size
-------   ---
Shirts     34
Shirts     36
Trouser    30
Shirts     34
Trouser    30
Trouser    32
Shoe        8
Shirts     34
Shoe        9
Saree       6

我们可以做这个吗

  Uniform  Size  cont
  -------  ----  -----
  Shirts   34     3
  Shirts   36     1
  Trouser  30     2
  Trouer   32     1
  shoe     8      1
  shoe     6      1
  saree    6      1

请帮我

4

1 回答 1

2
select uniform, size, count(uniform) from thetable group by uniform, size
于 2013-09-20T08:05:50.867 回答