表tb_table中有time列,类型为datatime,如何取当天时间的所有数据????另一题:表中有A、B、C三列,如果A大于B,取A否则取B,若B大于C则取B,否则取C,用sql实现求高手指教

解决方案 »

  1.   

    另一题:
    select decode(abs(a-b),a-b,a,b), 
    decode(abs(b-c),b-c,b,c)
    from table;
      

  2.   

    selecty * from tb_table where time  BETWEEN '2005-1-1' AND '2005-10-30'!LZ 加油!
      

  3.   

    //SQL查询当天的数据
    select * from 表 where DateDiff(dd,datetime,getdate())=0;
    //SQL查询当天24小时的数据
    select * from 表 where DateDiff(dd,datetime,getdate())=24;select Case when  A>B Then
                      A
                 else  Case where B>C Then
                      B
                       else 
                      c
                 end  
           end 
           From 表