我想选择昨天输入的数据我输入了两个代码,但效果不佳。代码和表结构是:
SELECT *
FROM reg_data3
WHERE date = CURDATE() - INTERVAL 1 DAY ;
SELECT *
FROM reg_data3
WHERE date = (str_to_date(date, '%m/%d/%Y')) - INTERVAL 1 DAY ;
CREATE TABLE `reg_data3` (
`date` varchar(10) NOT NULL default '',
`time` time NOT NULL,
`rainfall` float default NULL,
`evep` float default NULL,
`max_temp` float default NULL,
`min_temp` float default NULL,
`sunshine_hrs` float default NULL,
PRIMARY KEY (`date`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
答案 0 :(得分:0)