2
Trans|Store|Date
1    | 10  |9/01/13
2    | 10  |9/01/13
3    | 20  |9/01/13
4    | 10  |9/02/13

我想查询的是

(日期 = 9/01/13)

Store|#Trans|Date
10   | 2    |9/01/13
20   | 1    |9/01/13

我如何实现这一点?

4

2 回答 2

1

你可以试试这个:-

select store, count(*) as Transt from table
where Date = '9/01/13' 
group by store
于 2013-09-25T20:53:26.740 回答
0

如果不这样做,这可能。

Select
         count(Store) as #Trans,
         Store
    from
         tablename
    where
         Date = '9/01/13'
    group by
         Store

不过,这闻起来像家庭作业。

于 2013-09-25T20:56:09.433 回答