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新建表语句 请教一句sql 请问mysql库-->user表--->host字段--->%--->什么意思? 下面两句sql有什么不同么 关于dspace中数据存储 批处理文件问题 mysql 连接数为0的问题 高分求救 MYSQL 4.0 分不够可以再开一帖 求将SQL SERVER语句转换为MYSQL语句的问题,急救,50分,在线急等。 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')