Chinaunix

标题: 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

应该怎么改。多谢各位。
作者: ziggler    时间: 2008-12-09 10:40
错误信息哪?
作者: sunnyfun    时间: 2008-12-09 11:06
贴出表结构和试验数据啊




欢迎光临 Chinaunix (http://bbs.chinaunix.net/) Powered by Discuz! X3.2