时间点如何相加,时间段是可以的。愉快的登山者       ⊙
◢◣◢◣◢◣

解决方案 »

  1.   

    create table table1(
    tid int,
    outtime datetime)
    insert table1 select 1004,'1900-01-01 00:02:42'
    insert table1 select 1000,'1900-01-01 00:00:16'
    insert table1 select 1003,'1900-01-01 00:00:47'
    insert table1 select 1000,'1900-01-01 00:00:23'select tid, dateadd(ss, sum(datediff(ss, '1900-01-01 00:00:00', outtime)),'1900-01-01 00:00:00') 
    from table1 group by tidtid                                                                
    ----------- ------------------------------------------------------ 
    1000        1900-01-01 00:00:39.000
    1003        1900-01-01 00:00:47.000
    1004        1900-01-01 00:02:42.000(所影响的行数为 3 行)愉快的登山者       ⊙
    ◢◣◢◣◢◣