我有两张桌子
CREATE TABLE `reg_data` (
`date` varchar(10) NOT NULL,
`session` varchar(10) NOT NULL,
`time` time default NULL,
`temp_air` float NOT NULL,
`rel_humid` float NOT NULL,
`soil_temp_5` float NOT NULL,
`soil_temp_20` float NOT NULL,
`soil_temp_30` float NOT NULL,
`soil_temp_60` float NOT NULL,
`air_pressure` float NOT NULL,
`anem_reading` float NOT NULL,
`dry_temp` float NOT NULL,
`wet_temp` float NOT NULL,
PRIMARY KEY (`date`,`session`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
和
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;
我想使用date ='".$full."
传递来加入这两个表$full=$month.'/'.$day.'/'.$year;
。
我的查询是:
$sql ="(select A.date,A.rainfall,A.evep, A.max_temp, A.min_temp, A.sunshine_hrs,B.run , B.velocity From reg_data3 A ,velocity B where A.date=B.date ORDER by A.date) WHERE date ='".$full."' ;
这个查询有什么问题?