Oracle:
select * from table where trunc(field) = trunc(ADD_MONTHS(sysdate,-1))SQL Server:
select * from table where DATEDIFF(day, field,getdate()) = 30
select * from table where trunc(field) = trunc(ADD_MONTHS(sysdate,-1))SQL Server:
select * from table where DATEDIFF(day, field,getdate()) = 30
sqlstr="select count(*) as num from tab where trunc(inputtime) = trunc(ADD_MONTHS(sysDate,-1))";结果总是为零?
sql=select * from table where time-"+currentime+"<0 and "+lasttime+"-time>0;
timeEnd=(Interger.paesrInt(timeStart)+30).toString()
select * from tableName where currTime between timeStart and timeEnd