select addtime from ecom_order where date_format(addtime,'%Y%m%d')<'0927';
addtime为数据库字段,类型为timestamp,数据为-09-24 16:41:44
0927为传的参数,字符串类型。
该语句可查出9月27日之前的数据。
时间:2022-09-30 08:42:03
select addtime from ecom_order where date_format(addtime,'%Y%m%d')<'0927';
addtime为数据库字段,类型为timestamp,数据为-09-24 16:41:44
0927为传的参数,字符串类型。
该语句可查出9月27日之前的数据。