MySQL如何按照日期字段查询? 表Table1中有 日期字段TestDate,现在想按照天查询。但是MySQL不支持TestDate=?。该如何写呢?select * from Table1 where testdate .......?谢谢大家! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 你的代码是什么?为什么不支持TestDate=? MySQLSELECT qrybearing_even.Product_Number, QryBearing_Even.TestTime AS 检测时间FROM qrybearing_evenWHERE (QryBearing_Even.TestDate=?) select * from Table1 where testdate between '2011-09-15' and '2011-09-16'; 你那个?的是jdbc吧,没什么问题啊,只要参数设置正确,可以的啊,不过最好是设置java.sql.Date类型 select * from Table1 where testdate=‘2011-09-15' 如果你表中日期是带时间的。则可以select * from Table1 where date(testdate)=‘2011-09-15'或者考虑到利用索引则select * from Table1 where testdate between '2011-09-15' and '2011-09-15 23:59:59'; select * from Table1 where testdate=date_format(‘2011-09-15','%Y-%M-%d')是这个意思吗 表table1中 字段1 字段2 aaa 2011-9-1 bbb 2011-9-2 ccc 2011-9-3数据库用的mysql,现在我想得出 select * from table1 where 字段2=? 所查询得到的数据,但是提示 ? 错误。 但是在access里是可以运行的,请教大家该如何写呢? select * from table1 where 字段2='2011-09-01' 编写SP,将日期做为参数传递进去create procedure ff(aa datetime)beginselect * from table1 where 字段2=aaendcall ff('2011-09-01') MYSQL如何撤销误操作? MYSQL数据库 导入后,不能插入数据 用于排序:如何建立索引 DB2,Informix,Sybase哪个是非关系型的? 2表结构完全一致,是使用 连接查询? 恳请前辈们赐教啦 关于pgSQL数据库的备份和恢复 导入数据库问题请高手指教 MYSQL中一个表有8000W(8千万级)的数据,打算对一个URL字段去重,有什么快的方法,高手进! mysql 无法启动.查阅几个小时资料无法解决.前辈们进来看看 mysql同一连接多线程问题 如何查看整个服务器的SQL执行情况?
FROM qrybearing_even
WHERE (QryBearing_Even.TestDate=?)
或者考虑到利用索引则select * from Table1 where testdate between '2011-09-15' and '2011-09-15 23:59:59';
是这个意思吗
aaa 2011-9-1
bbb 2011-9-2
ccc 2011-9-3
数据库用的mysql,现在我想得出 select * from table1 where 字段2=? 所查询得到的数据,
但是提示 ? 错误。
但是在access里是可以运行的,请教大家该如何写呢?
create procedure ff(aa datetime)
begin
select * from table1 where 字段2=aa
endcall ff('2011-09-01')