1.添加索引、修改索引
-- 添加索引
create index ship_date_index on flo_sample (ship_date);
格式:
-- 修改索引
alter table flo_sample add index ship_date_index (ship_date);
2.日期格式应用
查询日期间隔天数
select DATEDIFF(SYSDATE(),ship_date) from flo_sample
查询前一天
select date_sub(curdate(),interval 1 day)