select 年月日,时分秒毫秒,事件对象名0,事件文字描述 from 历史事项表
where convert(char(8),年月日) like '200706%'
and convert(int,事件类型)=2004
为什么我的查询时间需要1分多钟 时间怎么这么长?
里面只有13条数据
这个SQL需要在那里优化?还是说是数据库出了问题?还有个问题就是:
我在程序中执行这个SQL
select 年月日,时分秒毫秒,事件对象名0,事件文字描述 from 历史事项表
where convert(char(8),年月日) like '200706%'
and convert(int,事件类型)=2004
时候 抱出:com.sybase.jdbc2.jdbc.SybSQLException: Incorrect syntax near '?'错误
大体知道这个是语法错误但是看不出来在那里出的
其中 convert(char(8),年月日) like '"+time+"%'是以参数的形式传入
where convert(char(8),年月日) like '200706%'
and convert(int,事件类型)=2004
为什么我的查询时间需要1分多钟 时间怎么这么长?
里面只有13条数据
这个SQL需要在那里优化?还是说是数据库出了问题?还有个问题就是:
我在程序中执行这个SQL
select 年月日,时分秒毫秒,事件对象名0,事件文字描述 from 历史事项表
where convert(char(8),年月日) like '200706%'
and convert(int,事件类型)=2004
时候 抱出:com.sybase.jdbc2.jdbc.SybSQLException: Incorrect syntax near '?'错误
大体知道这个是语法错误但是看不出来在那里出的
其中 convert(char(8),年月日) like '"+time+"%'是以参数的形式传入
呵呵舒舒服服地帮"shang_zchao(上潮的海)"顶一下