sybase中如何汇总行数据table

How do you summarize row data in sybase table

我在 sybase 中有这个 table:

Date                File_name   File_Size   customer    Id
1/1/205 11:00:00    temp.csv    100000      ESPN        1111
1/1/205 11:10:00    temp.csv    200000      ESPN        1122
1/1/205 11:20:00    temp.csv    400000      ESPN        1456
1/1/205 11:30:00    temp.csv    400000      ESPN        2345
1/2/205 11:00:00    llc.csv     100000      LLC         445
1/2/205 11:10:00    llc1.txt    200000      LLC         677
1/2/205 11:20:00    dtt.txt     500000      LLC         76
1/2/205 11:30:00    jpp.txt     400000      LLC         666

我需要想出一个查询来按天汇总这些数据,这将是 month/day/Year。

Date        total_file_size number_of_unique_customers number_unique_id
1/1/2015    110,000         1                          4
1/2/2015    120,000         1                          4 

如何在 sql 查询中执行此操作?我试过这个:

select convert(varchar,arrived_at,110) as Date 
   sum(File_Size), 
   count(distinct(customer)), 
   count(distinct(id)) 
group by Date

似乎没有用,有什么想法吗?

尝试

select 
   convert(varchar,arrived_at,110) as Date,
   SUM(File_Size), 
   count(distinct customer) as number_of_unique_customers, 
   count(distinct id ) as number_unique_id
group by convert(varchar,arrived_at,110)