java.sql.SQLSyntaxErrorException: ORA-00907: 缺失右括号

java.sql.SQLSyntaxErrorException: ORA-00907: 缺失右括号

问题描述:

select * from (

select a.*, ROWNUM rnum from (

select * from SHOP_ORDER
WHERE start_date between to_date(‘2016-08-22 11:34:36’,'yyyy/mm/dd hh24:mi:ss')

and close_date between to_date('2016-09-22 11:34:36','yyyy/mm/dd hh24:mi:ss') ) a where ROWNUM< ?) where rnum >= ?

求各位大神大牛帮帮小弟!!!!

‘2016-08-22 11:34:36’ 此处标点符号打错了。用的中文的
后一个between没有and

有中文单引号,不知道是不是这个原因

between需要and匹配

1.第一处单引号是中文的符号,要改成因为的
2.语法为 字段 between 数值a and 数值b 你这两个between很明显错了

另外‘2016-08-22 11:34:36’的前后引号都写成全角了。

select * from ( select a.*, ROWNUM rnum from ( select site_code,shop_order,target_qty,start_date,close_date,sales_order,customer_code,item_code,status ,remark,create_by,create_time,update_by,update_time from SHOP_ORDER WHERE shop_order = ? and start_date between to_date(?,'yyyy/mm/dd hh24:mi:ss') and close_date between to_date(?,'yyyy/mm/dd hh24:mi:ss') and status = ? ) a where ROWNUM < ?) where rnum >= ?

 (‘2016-08-22 11:34:36’,'y

标点符号错咯