求SQL语句或方法
在实际应用中,有这样一张表Tabel_1 
 sysid                        dtime                           PLC0_1      PLC0_2      PLC0_3      PLC0_4      PLC0_5   …PLC100 
       1         2007-05-30   11:22:01            22                  12                  25               23                     37 
       2         2007-05-30   11:22:02            20                  52                  45               28                     36 
       3         2007-05-30   11:22:03            20                  52                  45               28                     38 
 …… 
    59         2007-05-30   11:22:59            30                  62                  42               24                     26 
 词表中共有100个字段,分别对应不同的采集量. 
 要处理的是:提取每分钟内,每个字段的最大值和最小值及其相应的时间,并按时间的先后顺序存储于另一张结构类似的表Table_2。   
 sysid                        dtime                           PLC0_1      PLC0_2      PLC0_3      PLC0_4      PLC0_5   …PLC100 
       1         2007-05-30   11:22:00            20                  12                  25               23                     26 
       2         2007-05-30   11:22:00            30                  62                  45               28                     38      
 提取策略为每个字段单独求并比较时间,然后存储,遇到的问题是:执行速度特别慢,有什么好的Sql语句或方法能解决吗? 
------解决方案--------------------試下:   
 insert into Table_2(dtime ,PLC0_1,PLC0_2,PLC0_3,PLC0_4 ,PLC0_5 …PLC100) 
 select convert(varchar(16),dtime,120), min(PLC0_1),min(PLC0_2),min(PLC0_3)...min(PLC100) 
 from Table_1 
 group by convert(varchar(16),dtime,120) 
 union all 
 select convert(varchar(16),dtime,120),max(PLC0_1).....max(PLC100) 
 from Table_1 
 group by convert(varchar(16),dtime,120)