标题: DATE_FORMAT用在多重查询时出错 [打印本页] 作者: bandaotidejia 时间: 2008-12-08 17:18 标题: DATE_FORMAT用在多重查询时出错 select p.id, p.siteid, p.submitor, p.date, p.type, p.summery, p.status from prob
lem p, site s, account a where p.siteid=s.id and s.accountid=a.id and a.disable=
0 and s.disable=0 and p.disable=0 and p.id=15 and DATE_FORMAT(p.date,'%Y-%m-%d')= '2008-11-12' order by p.id
这句话会出错,但如下的语句没错
select id, siteid, submitor, date, type, summery, status from problem where disable=0 and DATE_FORMAT(date,'%Y-%m-%d')= '2008-11-12' order by id