怎么在datatable.selec()中,把系统时间赋值进去,让它与表中的一个时间类型的时段相减
数据库中:select * from a where sysdate-date<=7
用的数据库是Oracle

解决方案 »

  1.   

    select * from a where datediff(day,getdate(),sysdate)<7
      

  2.   

    你实在不行就把该字段取出来。。在程序里面操作。。然后在进行select
      

  3.   


                DataTable t = new DataTable();
                
                t.Columns.Add("No", typeof(int));
                t.Columns.Add("Name", typeof(string));            t.Rows.Add(1,"Kevin");
                t.Rows.Add(2, "Alison");
                t.Rows.Add(3, "Sophie");
                t.Rows.Add(4, "Vicky");
                t.Rows.Add(5, "Cherry");            DataRow[] rows = t.Select("No>=3");
      

  4.   

    不如你直接写select语句的时候就把 sysdate-date 写进去做一列
    select ... sysdate-date as timespan from tablename