mysql查询xx天以内的数据

 SELECT
 up.ID,up.DATA_TIME,up.DATA_VALUE,up.CREATE_TIME,up.CREATOR_ID,up.MODIFY_TIME,up.MODIFIER_ID,up.STATE
FROM
tablename AS up
 WHERE
  DATE_FORMAT(up.CREATE_TIME,'%Y-%m-%d')>=DATE_SUB(curdate(),interval #{sqlCond.dayNum} day)
 and DATA_VALUE IS NOT NULL

 

你可能感兴趣的:(大数据,数据库,前端,java后台,echarts)