SQLSyntaxErrorException: ORA-00907: 缺失右括号

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 >= ?

大神大牛帮帮忙。

1个回答

between...and又写错了
start_date between to_date(?,'yyyy/mm/dd hh24:mi:ss') and to_date(?,'yyyy/mm/dd hh24:mi:ss')

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
ORA-00907:缺失右括号
CREATE TABLE WEB_CULTURE(rnCULTURE_ID NUMBER(10),rnCULTURE_TITLE VARCHAR2(500),rnCULTURE_TYPE NUMBER(10),rnCULTURE_DATE DATE(7),rnDEPT VARCHAR2(100),rnCULTURE_CONTENT BLOB,rnCULIMG_URL VARCHAR2(256),rnCUL_TITLE VARCHAR2(128),rnCONSTRAINT WEB_CULTURE PRIMARY KEY (CULTURE_ID)rn);rn这段建表语句报 ORA-00907:缺失右括号
ORA-00907: 缺失右括号
Oracle版半天沒有人,很著急,所以來熟悉的C++版rnrn代码是按照书本上来的.......求前辈指点。rnrnSQL> CREATE TABLE XS_KCrn 2 (rn 3 XH CHAR(6) NOT NULL ,rn 4 KCH CHAR(6) NOT NULL ,rn 5 CJ NUMBER(2) NULL,rn 6 XF NUMBER(2) NULL,rn 7 CONSTRAINT "PK_XS_KC" PRIMARY KEY("XH", "KCH")rn 8 TABLESPACE MYTS rn 9 ) ;rn TABLESPACE MYTSrn *rn第 8 行出现错误:rnORA-00907: 缺失右括号
ORA-00907 缺失右括号
SELECTrnxmlid.nextval,rn''rnrnrnrnFROM user_tab_columns t WHERE t.TABLE_NAME=vtab;rnrn变量是前面存过定义好的。 rn
ora-00907: 缺失右括号
在pl/sql里执行  报此错rnselect TEMQ_1f040dd124f08b2ce1.GW GW,rn TEMQ_1f040dd124f08b2cb2.GZRQ GZRQ,rn TEMQ_1f040dd124f08b2bd8.DH DH,rn TEMQ_1f040dd124f08b2bd8.XKHSM XKHSM,rn TEMQ_1f040dd124f08b2c83.KHZS KHZS,rn TEMQ_1f040dd124f08b2c83.KHZS - TEMQ_1f040dd124f08b2bd8.XKHSM LKHZS,rn TEMQ_1f040dd124f08b2cb2.LDZS LDZS,rn TEMQ_1f040dd124f08b2cb2.QDZS QDZS,rn TEMQ_1f040dd124f08b2cb2.QFZS QFZS,rn TEMQ_1f040dd124f08b2d20.QYTS QYTS,rn TEMQ_1f040dd124f08b2d20.MJ MJ,rn TEMQ_1f040dd124f08b2d20.JE JE,rn TEMQ_1f040dd124f08b2d20.YSJE YSJE,rn TEMQ_1f040dd124f08b2d20.QKJE QKJE,rn sum(TEMQ_1f040dd124f08b2cb2.LFZS) LFZSrn from TEMQ_1f040dd124f08b2cb2,rn TEMQ_1f040dd124f08b2bd8,rn TEMQ_1f040dd124f08b2c83,rn TEMQ_1f040dd124f08b2d20,rn TEMQ_1f040dd124f08b2ce1rn where TEMQ_1f040dd124f08b2cb2.GZRQ = TEMQ_1f040dd124f08b2bd8.DJRQrn and TEMQ_1f040dd124f08b2cb2.GZRQ = TEMQ_1f040dd124f08b2c83.GZRQrn and TEMQ_1f040dd124f08b2cb2.GZRQ = TEMQ_1f040dd124f08b2d20.QYRQrn and TEMQ_1f040dd124f08b2cb2.PK_PSNDOC =rn TEMQ_1f040dd124f08b2ce1.PK_PSNDOCrn and ((TEMQ_1f040dd124f08b2ce1.PK_CORP = '1008') andrn (TEMQ_1f040dd124f08b2bd8.PK_PSNDOC = '0001G510000000001X90') andrn (TEMQ_1f040dd124f08b2c83.PK_PSNDOC = '0001G510000000001X90') andrn (TEMQ_1f040dd124f08b2cb2.PK_PSNDOC = '0001G510000000001X90') andrn (TEMQ_1f040dd124f08b2d20.PK_PSNDOC = '0001G510000000001X90') andrn (TEMQ_1f040dd124f08b2ce1.PK_PSNDOC = '0001G510000000001X90') andrn (TEMQ_1f040dd124f08b2bd8.PK_PROJECT = '0001G510000000000E8S') andrn (TEMQ_1f040dd124f08b2c83.PK_PROJECT = '0001G510000000000E8S') andrn (TEMQ_1f040dd124f08b2cb2.PK_PROJECT = '0001G510000000000E8S') andrn (TEMQ_1f040dd124f08b2d20.PK_PROJECT = '0001G510000000000E8S') andrn (TEMQ_1f040dd124f08b2ce1.PK_PROJECT = '0001G510000000000E8S') andrn (TEMQ_1f040dd124f08b2cb2.GZRQ >= 'select trunc(next_day(to_date('rn 2009 - 10 - 30 ', ' yyyy - mm - dd '), 1) - 6) from dual') andrn (TEMQ_1f040dd124f08b2cb2.GZRQ <= 'select trunc(next_day(to_date('rn 2009 - 10 - 30 ', ' yyyy - mm - dd '), 1) ) from dual'))rn group by TEMQ_1f040dd124f08b2ce1.GW,rn TEMQ_1f040dd124f08b2cb2.GZRQ,rn TEMQ_1f040dd124f08b2bd8.DH,rn TEMQ_1f040dd124f08b2bd8.XKHSM,rn TEMQ_1f040dd124f08b2c83.KHZS,rn TEMQ_1f040dd124f08b2c83.KHZS - TEMQ_1f040dd124f08b2bd8.XKHSM,rn TEMQ_1f040dd124f08b2cb2.LDZS,rn TEMQ_1f040dd124f08b2cb2.QDZS,rn TEMQ_1f040dd124f08b2cb2.QFZS,rn TEMQ_1f040dd124f08b2d20.QYTS,rn TEMQ_1f040dd124f08b2d20.MJ,rn TEMQ_1f040dd124f08b2d20.JE,rn TEMQ_1f040dd124f08b2d20.YSJE,rn TEMQ_1f040dd124f08b2d20.QKJErn请赐教
ora-00907 缺失右括号?????
SELECT /*+ parallel (statcmain )*/ rn sum(decode(statcmain.certitype,''P'', 1,decode(statcmain.endortype, ''19'', ''-1'', 0))) as Count, rn sum((STATCMAIN.CHGPREMIUM - STATCMAIN.CHGMIDDLECOST) * STATCMAIN.CNYEXCHRATE * STATCMAIN.COINSRATE / 100) as premium, rn sum(STATCMAIN.CHGINSURED * STATCMAIN.CNYEXCHRATE * STATCMAIN.COINSRATE / 100) as amount, rn sum(STATCMAIN.CHGLIMIT * STATCMAIN.CNYEXCHRATE * STATCMAIN.COINSRATE / 100) as limit rn FROM rep.Statcmain, rn reptest.statcogsharerate, rn rep.statdcompanylevel rn where Statcmain.Policyno = statcogsharerate.policyno(+) rn and statcmain.comcode = statdcompanylevel.comcode rn and statcmain.riskcode NOT IN (''YAB0'', ''2797'', ''2798'') rn AND STATCMAIN.CLASSCODE <> ''30'' rn group by statcmain.statdate, rn statcmain.StartDate, rn statcmain.COMCODE, rn decode(statcmain.riskcode, rn ''2700'', rn statcmain.productcode, rn statcmain.riskcode), rn statcmain.SHAREHOLDERFLAG, rn statcmain.BUSINESSNATURE, rn ((substr(statcmain.othflag, 1, 1))), rn statdcompanylevel.centercode, rn statcmain.Agentcode, rn statcmain.Handler1code, rn decode(substr(statcmain.othflag, 15, 1), rn NULL, rn ''0'', rn substr(statcmain.othflag, 15, 1)), rn statcmain.BusinessKind, rn statcmain.BusinessClass, rn CASE WHEN (statcmain.businessflag IS NULL OR statcmain.businessflag <> ''1'') THEN (''0'') rn ELSE (''1'') END, rn statcmain.businesssource, rn statcmain.constructtype,rn statcmain.channeltype,rn statcmain.servicearea,rn statcmain.agriFlag,rn statcmain.usenaturecode,rn statcmain.carkindcode,rn statcmain.toncount,rn statcmain.applitype,rn statcmain.ventureflag, rn statcmain.grouppurchaseflag;rn
ORA-00907: 缺失右括号问题!!!???
今天遇到了数据库建表时的问题:ORA-00907: 缺失右括号问题!!!???rnrnrn我的SQL脚本如下:rnrncreate table sys_managers(ID bigint NOT NULL PRIMARY KEY,rnname varchar(28) NOT NULL,rnsex varchar(4) NOT NULL,rnage int(3) NOT NULL,rnaddress varchar(100) NOT NULL,rnpassword varchar(18) NOT NULL,rnrole varchar(28) NOT NULL,rnflag varchar(6) NOT NULL,rnflag2 varchar(6) default null,rndegree varchar(8) not null,rnpositional_title varchar(18) default null,rndate1 date not null,rndate2 date default null,rnflag3 varchar default null,rnself TEXT default null)ENGINE=InnoDB DEFAULT CHARSET=gb2312;rnrn若在MySQL中,会出现如附图片的报错信息。rn请教各位大神该如何修改,解决问题啊?rnrnrn
java.sql.SQLException: ORA-00907: 缺失右括号
String sqlTablespace = "select upper(f.tablespace_name) \"Tablespace\",d.tot_grootte_mb \"Size MB\",f.total_bytes \"Free MB\","rn + "to_char(round(f.total_bytes/ d.tot_grootte_mb * 100,2),'990.99') \"Percent Free\","rn + "d.autoextensible from (select tablespace_name,round(sum(bytes) /(1024 * 1024), 2) total_bytes,round(max(bytes) / (1024 * 1024),"rn + " 2) max_bytes from sys.dba_free_space group by tablespace_name) f,"rn + "(select dd.tablespace_name,round(sum(dd.bytes)/(1024 * 1024), 2) tot_grootte_mb,"rn + "round(sum(dd.maxbytes)/(1024 * 1024), 2) tot_tbs_mb,dd.autoextensible from sys.dba_data_files dd"rn + "group by dd.tablespace_name,dd.autoextensible) d"rn + " where d.tablespace_name = f.tablespace_name order by f.tablespace_name";
java.sql.SQLSyntaxErrorException: ORA-00907: 缺失右括号
select * from ( nnselect a.*, ROWNUM rnum from ( nnselect * from SHOP_ORDER nWHERE start_date between to_date(‘2016-08-22 11:34:36’,'yyyy/mm/dd hh24:mi:ss') nand close_date between to_date('2016-09-22 11:34:36','yyyy/mm/dd hh24:mi:ss') ) a where ROWNUM< ?) where rnum >= ?nnnn求各位大神大牛帮帮小弟!!!!
ORA-00907: 缺失右括号 问题!!!???
rnrn creat table xh_projectrn(rn pk_project int(4),rn project_code varchar(20),rn project_name varchar(60),rn iflock varchar(1) not null,rn ifmerge varchar(1) not null,rn ts char(19) convert(char(19),getdate(),20),rn dr smallint(2) default 0,rn constraint P_pk_xh_project primary key (pk_project)rn);rnrn 报错提示: ORA-00907:缺失右括号 rn 请各位帮忙!rn 数据库使用的是 oracle数据库。rn rn 同样的语句 下面的创建表就可以执行:rncreate table wa_qx_parameterrn(rn pk_parameter CHAR(20) not null,rn param_code VARCHAR(20) not null,rn param_name VARCHAR(100) not null,rn param_value VARCHAR(20) not null,rn approveflag SMALLINT default 0,rn mender VARCHAR(20),rn assessor VARCHAR(20),rn amend_date CHAR(19),rn remark VARCHAR(500),rn ts CHAR(19),rn dr SMALLINT default 0,rn constraint P_pk_wa_qx_paramet primary key (pk_parameter)rn); rn
ORA-00907: 缺失右括号问题整理解决
ORA-00907: 缺失右括号前言        最近在开发过程中使用oracle数据库,在程序中进行查询数据时遇到了“ORA-00907: 缺失右括号”的问题,但是如果直接把sql语句直接在数据库或PL/SQL中执行时,却又能够正常查询,为了解决这个问题,折腾了半天,查找了一些资料,所以就对各种导致出现“缺失右括号”的情况进行了整理总结。行文如下。1 union all中order by 导致
mybatis分页查询时ORA-00907: 缺失右括号
mybatis语句:rn[code=text]rnSELECT * FROMrn (SELECT rn id as id,rn appserialnumber as appserialnumber,rn who as who,rn createtime as createtime,rn operatedtype as operatedtype,rn operate as operate,rn operatedobject as operatedobject,rn description as description,rn result as result,rn ROWNUM AS row_numrn FROM server_log ROWNUM < (#startRecord+#total)) t_temprn WHERE t_temp.row_num >= #startRecordrn[/code]rnrn然后控制台打印语句:rn10:06:51,114 DEBUG Connection:27 - ooo Connection Openedrn10:06:51,442 DEBUG PreparedStatement:27 - ==> Executing: select count(*) from server_log rn10:06:51,442 DEBUG PreparedStatement:27 - ==> Executing: select count(*) from server_log rn10:06:51,442 DEBUG PreparedStatement:27 - ==> Parameters: rn10:06:51,442 DEBUG PreparedStatement:27 - ==> Parameters: rn10:06:51,630 DEBUG Connection:27 - ooo Connection Openedrn10:06:51,646 DEBUG PreparedStatement:27 - ==> Executing: SELECT * FROM (SELECT id as id, appserialnumber as appserialnumber, who as who, createtime as createtime, operatedtype as operatedtype, operate as operate, operatedobject as operatedobject, description as description, result as result, ROWNUM AS row_num FROM server_log ROWNUM < (?+?)) t_temp WHERE t_temp.row_num >= ? rn10:06:51,646 DEBUG PreparedStatement:27 - ==> Executing: SELECT * FROM (SELECT id as id, appserialnumber as appserialnumber, who as who, createtime as createtime, operatedtype as operatedtype, operate as operate, operatedobject as operatedobject, description as description, result as result, ROWNUM AS row_num FROM server_log ROWNUM < (?+?)) t_temp WHERE t_temp.row_num >= ? rn10:06:51,646 DEBUG PreparedStatement:27 - ==> Parameters: 0(Integer), 10(Integer), 0(Integer)rn10:06:51,646 DEBUG PreparedStatement:27 - ==> Parameters: 0(Integer), 10(Integer), 0(Integer)rn2014-8-1 10:06:51 org.apache.catalina.core.StandardWrapperValve invokern严重: Servlet.service() for servlet SearchServlet threw exceptionrnorg.apache.ibatis.exceptions.PersistenceException: rn### Error querying database. Cause: java.sql.SQLException: ORA-00907: 缺失右括号rnrn### The error may involve com.itrus.mylog.domain.ServerLog.selectAllServerLog-Inlinern### The error occurred while setting parametersrn### Cause: java.sql.SQLException: ORA-00907: 缺失右括号rnrn at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:8)rn at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:77)rn at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:69)rn at com.itrus.mylog.dao.impl.SearchDAOImpl.searchPagination(SearchDAOImpl.java:37)rn at com.itrus.mylog.service.impl.SearchServiceImpl.searchPagination(SearchServiceImpl.java:24)rn at com.itrus.mylog.servlet.SearchServlet.search(SearchServlet.java:53)rn at com.itrus.mylog.servlet.SearchServlet.service(SearchServlet.java:40)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)rn at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)rn at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)rn at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)rn at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)rn at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)rn at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)rn at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)rn at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:602)rn at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)rn at java.lang.Thread.run(Thread.java:619)rnCaused by: java.sql.SQLException: ORA-00907: 缺失右括号rnrn at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)rn at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:331)rn at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:288)rn at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:743)rn at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:213)rn at oracle.jdbc.driver.T4CPreparedStatement.executeForDescribe(T4CPreparedStatement.java:796)rn at oracle.jdbc.driver.OracleStatement.executeMaybeDescribe(OracleStatement.java:1031)rn at oracle.jdbc.driver.T4CPreparedStatement.executeMaybeDescribe(T4CPreparedStatement.java:836)rn at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1116)rn at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3285)rn at oracle.jdbc.driver.OraclePreparedStatement.execute(OraclePreparedStatement.java:3390)rn at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)rn at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)rn at java.lang.reflect.Method.invoke(Method.java:597)rn at org.apache.ibatis.logging.jdbc.PreparedStatementLogger.invoke(PreparedStatementLogger.java:45)rn at $Proxy1.execute(Unknown Source)rn at org.apache.ibatis.executor.statement.PreparedStatementHandler.query(PreparedStatementHandler.java:39)rn at org.apache.ibatis.executor.statement.RoutingStatementHandler.query(RoutingStatementHandler.java:55)rn at org.apache.ibatis.executor.SimpleExecutor.doQuery(SimpleExecutor.java:41)rn at org.apache.ibatis.executor.BaseExecutor.queryFromDatabase(BaseExecutor.java:216)rn at org.apache.ibatis.executor.BaseExecutor.query(BaseExecutor.java:95)rn at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:72)rn at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:75)rn ... 18 morernrn求指点,是语句哪里写错了么?
ORA-00907: 缺失右括号与左括号问题总结
在创建数据表总结如下:  1.date限定字段大小的时候,会报错,比如,将date(12)去掉(12);  2.关键字顺序有误,也会报这样的错;  3.创建表时,如果表有关键字,用双引号括起来;  4.如果创建表时,未对字段中的表设置长度,也会报错;  5.创建主外键约束时外键类型跟主键类型不完全一致,也是会报错的。  ...
ORA-00907: 缺少右括号
[img]http://dl2.iteye.com/upload/attachment/0094/0197/219d7536-01cb-3617-8b6b-9454ad67bf83.jpg[/img] 在一个应用系统,提供了运行 ORQCLE SQL 的功能。对于简单的 SQL 语句的运行一切正常,而对于有子查询的复杂 SQL 语句,经常会出现错误。但是,这个语句在 DQL PLUS 中运行...
ora-00907 缺少右括号
我在我的数据库中对另一个数据库建立了链路,并对一个本建了同义词,访问没有问题。rn 我想利用一个过程把这个表的数据导入的我本地服务器中。rn 我建了一个RECORD,中有一个字段类型是DATE的,对应远程表中一个DATE类型字段,rn 但是FETCH后,组成生成的SQL语句的时候,字段的数据由YYYY-MM-DD HH24:MI:SS变成了DD-MM-YY形式了。rn 所以在执行SQL语句时,提示ora-00907 缺少右括号rn 我本地数据的DATE类型格式也为YYYY-MM-DD HH24:MI:SS,但是FETCH后为什么格式变了呢?
第 12 行出现错误: ORA-00907: 缺失右括号
create table T_RECV_MSG (rn DBID number(11) not null,rn STATUS number(11) default 0,rn SEQID varchar(20) default '',rn CALLNO varchar(20) default '',rn DSTCALLNO varchar(20) default '',rn SERVICEID varchar(20) default '',rn LINKID varchar(20) default '',rn SENDTIME date default sysdate,rn CONTENT varchar(4000) default '',rn OPERATOR varchar(20) default '',rn UDHI int(11) default -1, rn primary key (DBID)rn);rnUDHI int(11) default -1,rn *rn第 12 行出现错误:rnORA-00907: 缺失右括号rn求教,哪错了rn
缺失右括号的问题??
[code=SQL]rn我现在有一个这样的 过程 rn但是执行总是报 缺失右括号 不知道为什么 大家帮忙看看rnrncreate or replace procedure test_p isrntype tcur is ref cursor;rnfi_cur1 tcur;rndos1 date;rndos30 date;rnbeginrndos1 := to_date('2006-01-01','yyyy-mm-dd');rndos30 := to_date('2006-11-01','yyyy-mm-dd');rn open fi_cur1 for ' select distinct mbrid from fi06rn where ( mbrid=''1000'' and dos >= '||dos1||' and dos <= '||dos30||')';rn--。。。。rnend test_p;rn[/code]
缺失右括号
例如:rncrate table a(id not null number(4)); 就会报错:缺少")"rn但是:rncreate table a(id number(4) not null); 就不会报错。rn为什么呢?rnnot null 一定要放到后面吗?
缺失右括号问题
最近刚开始学ORACLE, 用的10gEX版本,用HR账号登陆。rn下面的语句: update jobs set max_salary = (1000+(select avg(max_salary) from jobs)) where job_id = 'AD_VP';没有问题。rn不过如果把+1000 放在后面变成:update jobs set max_salary = ((select avg(max_salary) from jobs)+1000) where job_id = 'AD_VP';rn就会提示缺失右括号。百思不得其解~~~rn分不多了,希望大家不吝赐教
缺失右括号????
我在创建一个表时,这两行老师提示缺失右括号rn去掉这两行就没问题rn没缺失右括号呀rn这是为什么?rnrn gender varchar2(10) ck_agents_gender check((gender='m')or(gender='f')),rn cellphone nvarchar2(20) uu_agents_cellphone unique
c++builder中的SQL语句出错:ORA-00907:缺失右括号
c++builder中的SQL语句出错:rn AnsiString stime,etime;rn stime="2008-12-9 1:18:00"; rn etime="2008-12-9 3:25:00"; rn ADOQuery1->Close();rn ADOQuery1->SQL->Clear();rn ADOQuery1->SQL->Add("Select distinct tag_value.* from tag_value where tag_value.clock> to_date('"+stime+"','yyyy-mm-dd hh24:mi:ss') and tag_value.id=134 or tag_value.id=129 or tag_value.id=130 and tag_value.clock<= to_date ('"+etime+"','yyyy-mm-dd hh24:mi:ss') order by tag_value.clock");rn ADOQuery1->Open();rn出现错误rn ORA-00907:缺失右括号rnrnrn如果将SQL语句改成Select distinct tag_value.* from tag_value where tag_value.clock> to_date('"+stime+"','yyyy-mm-dd [color=#FF0000]hh24:mi'[/color]) and tag_value.id=134 or tag_value.id=129 or tag_value.id=130 and tag_value.clock<= to_date ('"+etime+"','yyyy-mm-dd [color=#FF0000]hh24:mi'[/color]) order by tag_value.clockrn就不会出错!rn搞不清楚是怎么回事?请教各位大侠!
数据库建表的问题 ORA-00907: 缺失右括号问题!!!???
报错:ORA-00907: 缺失右括号问题!!!???rnrn我的建表脚本如下所示:rnrncreate table sys_managers(ID bigint NOT NULL PRIMARY KEY,rnname varchar(28) NOT NULL,rnsex varchar(4) NOT NULL,rnage int(3) NOT NULL,rnaddress varchar(100) NOT NULL,rnpassword varchar(18) NOT NULL,rnrole varchar(28) NOT NULL,rnflag varchar(6) NOT NULL,rnflag2 varchar(6) default null,rndegree varchar(8) not null,rnpositional_title varchar(18) default null,rndate1 date not null,rndate2 date default null,rnflag3 varchar default null,rnself TEXT default null)ENGINE=InnoDB DEFAULT CHARSET=gb2312;rnrnrn请教各位这是什么错误啊,该如何修改捏?rnrn若在MySQL中会出现rn[img=https://img-bbs.csdn.net/upload/201309/17/1379424206_904450.jpg][/img]rn如图所示错误。rnrn请教各位这是什么错误啊,该如何修改捏?
oracle查询语句老是报ORA-00907缺失右括号
--大家好,我有一条oracle查询语句老是报ORA-00907缺失右括号的错误,能不能帮我看一下,谢谢:rn--统计毕业班等级考试最佳成绩rnselect distinct e.xy 学院,rn e.xzb 班级,rn e.xh 学号,rn e.xm 姓名,rn a.cet3 英语三级,rn b.cet4 英语四级,rn c.cet6 英语六级,rn d.computer 计算机rn from ((select xh, xm, djksmc, max(cj) cet3rn from xsdjksbrn where djksmc = '英语三级'rn Group by xh, xm, djksmc) a,rn (select xh, xm, djksmc, max(cj) cet4rn from xsdjksbrn where djksmc = '英语四级'rn Group by xh, xm, djksmc) b,rn (select xh, xm, djksmc, max(cj) cet6rn from xsdjksbrn where djksmc = '英语六级'rn Group by xh, xm, djksmc) c,rn (select xh, xm, djksmc, max(cj) computerrn from xsdjksbrn where djksmc like '计算机%'rn Group by xh, xm, djksmc) d, xsjbxxb e)rn where (a.xh = e.xh or b.xh = e.xh or c.xh = e.xh or d.xh = e.xh)rn and ((e.DQSZJ = '2010' AND e.XZ = '5') ORrn (e.DQSZJ = '2011' AND e.XZ = '4') ORrn (e.DQSZJ = '2012' AND e.XZ = '3'))rn AND e.SFZX = '是'rn order by e.xy, e.xzb, e.xh, e.xm;rnrnrn报错落在 djksmc) a,的a上rnrn我确信我的语句所有的左右括号都是匹配的,没有缺失,一定是语句的语法出了问题,请大家帮我把把关,谢谢!
奇怪的问题 ORA-00907: 缺少右括号
一个非常奇怪的问题rnrn存储过程建立如下rnCREATE OR REPLACE PROCEDURE go (id integer)rnIS rnBEGIN rn return;rnEND go;rnrn在 SQL Plus中调用结果如下rnrnSQL> call go(0);rnrnMethod calledrnrnSQL> call go(id => 0);rnrncall go(id => 0)rnrnORA-00907: 缺少右括号rnrnSQL> rnrnrn怎么会有 ORA-00907: 缺少右括号 这个错误
oracle 建表缺失右括号
CREATE TABLE BSI_AREA(rn ADCODE VARCHAR(20) NOT NULL,rn AREANAME VARCHAR(100),rn AREAPOLYSTR CLOB(1048576),rn AREACENTERLON DECIMAL(19,15),rn AREACENTERLAT DECIMAL(19,15),rn CITY_ID VARCHAR(20),rn PARENTID VARCHAR(12),rn CONSTRAINT PK_BSI_AREA PRIMARY KEY(ADCODE));rnrn以上是语句,建好了很多表都是这么写的,这个表就说啥都报错,SQL 错误: ORA-00907: 缺失右括号。rn自己尝试给表里的列分别删了就留一列还是不好用,无法定位问题原因,水平比较低,肯定各位大神走过路过帮忙看看。
sql语句缺失右括号
我是根据前台传过来的年龄段对人员表里的生日字段进行查询rnsql语句如下rn[code=sql] select * from BC_BCOA_PERSON WHERE PERSON_ID != 0 and PERSON_DELETE=0 and(YEAR (CURDATE()) -1 - YEAR (PERSON_BIRTHDAY) + (DATE_FORMAT(PERSON_BIRTHDAY,'%m%d') <= (DATE_FORMAT(CURDATE(), '%m%d'))))>=20 AND (YEAR (CURDATE()) -1 - YEAR (PERSON_BIRTHDAY) + (DATE_FORMAT(PERSON_BIRTHDAY, '%m%d') <= (DATE_FORMAT(CURDATE(), '%m%d'))))<=100 [/code]rnrn谢谢大家
sql代码缺失右括号
sb.append("select MCHT_NO,MCHT_NM,LICENCE_NO,APPLY_DATE,MAPPING_MCHNTCDONE,MAPPING_MCHNTCDTW O,MCHT_STATUS,TERM_COUNT from ");rnsb.append("((SELECT * FROM TBL_MCHT_BASE_INF_TMP t1 left outer join TBL_BRH_INFO t2 on t2.brh_id=t1.agr_br ) A left outer join (select MCHT_CD,count(1) AS TERM_COUNT from TBL_TERM_INF group by MCHT_CD) B ON (A.MCHT_NO = B.MCHT_CD))");rnsb.append("where MCHT_STATUS IN ('1','3','5','6','8','R') ");rnrnrn运行的时候显示上述代码缺失右括号,但是在数据库中可以运行出来,这是什么原因
老提示:ORA-00907: 缺少右括号
我在ORCALE里面建表,老提示错误:ORA-00907: 缺少右括号rnCREATE TABLE myuser2(rnid int(11) not null,rnusername varchar(200) not null,rnpassword varchar(20) not null,rnage int,rnprimary key (id)rn)rnENGINE=MyISAM DEFAULT CHARSET=GBK;rnrn请高手指教
ORA-00907: 缺少右括号(sql的问题)
下面是jsp的一点代码rnrn//取得当前时间rnjava.util.Date date=new java.util.Date();rnString year=String.valueOf(date.getYear()+1900);rnString mon=String.valueOf(date.getMonth()+1);rnString day=String.valueOf(date.getDate());rnString hour=String.valueOf(date.getHours());rnString min=String.valueOf(date.getMinutes());rnString sec=String.valueOf(date.getSeconds());rnrnString sql_post="insert into R_text values(R_TEXT_SEQ.nextval,";rnsql_post+=title+",";rnsql_post+=body;rnsql_post+=",'applytype',";rnsql_post+="todate(year-mon-day hour:min:sec,'yyyy-mm-dd hh24:mi:ss')";rnsql_post+=",'author',";rnsql_post+="'provide',";rnsql_post+="'searchkey',";rnsql_post+="todate(year-mon-day hour:min:sec,'yyyy-mm-dd hh24:mi:ss')";rnsql_post+=",'videopath',";rnsql_post+="'texttype',";rnsql_post+="'authorinfo',";rnsql_post+="todate(year-mon-day hour:min:sec,'yyyy-mm-dd hh24:mi:ss'),";rnsql_post+="10,";rnsql_post+="'course')";rnrnrntryrnstmt_post.executeUpdate(sql_post);rncatch (SQLException e) rn System.out.println("sql failed :"+e.toString());rn rn===========下面执行结果=============rnsql failed :java.sql.SQLException: ORA-00907: 缺少右括号
ORA-00907: 缺少右括号 错误 急!!!
declare rnv_sql varchar2(1024);rnbeginrnv_sql := 'create global temporary table t_temp_accountrn (materialID varchar2(7),rn start_amount number(5,0),rn start_money number(10,2),rn in_amount nmuber(5,0),rn in_money number(10,2),rn out_amount number(5,0),rn out_money number(10,2),rn finish_amount number(5,0),rn finish_money number(10,2)rn )on commit preserve rows';rn execute immediate v_sql;rnend;rn执行后 出现错误rndeclarern*rnERROR 位于第 1 行:rnORA-00907: 缺少右括号rnORA-06512: 在line 15rn我的sql语句没有错误的阿 找了半天 望高手指教!
oracle 插入数据时缺失右括号???
这是我建的表: rncreate table users(rn userid varchar2(30) primary key,rn username varchar2(30) not null,rn userpassword varchar2(30) not nullrn );rn这个没有报错,当我插入数据时,就出现了右括号缺失这个错误,大家帮帮忙吧!我是新手,很多都不懂。谢谢哈!rn这是我插入的数据:insert into users select ('1','david','123456')。
新手求教,缺失右括号异常。
create table UserInforn(rn UserId number(5) primary key, ---非空 主键编号rn UserName varchar(20) unique not null , --非空 唯一用户名rn UserPwd varchar(20) not null, --非空 登录密码rn Balance number(5) not null --非空 余额rn);rnrn这段代码说是缺失右括号rn但当我把最后的分号删后rncreate table UserInforn(rn UserId number(5) primary key, --非空 主键编号rn UserName varchar(20) unique not null , --非空 唯一用户名rn UserPwd varchar(20) not null, --非空 登录密码rn Balance number(5) not null --非空 余额rn)rn这里又没事了,rn不删分号,我把前两行注释删了rncreate table UserInforn(rn UserId number(5) primary key, rn UserName varchar(20) unique not null , rn UserPwd varchar(20) not null, --非空 登录密码rn Balance number(5) not null --非空 余额rn);rn段代号也是好的,怎么回事啊????
一存储过程,提示缺失右括号问题
一个按时间做的范围分区,现做了一个通用的存储过程,代码如下:rn[code=SQL]rnrncreate or replace procedure addpart(v_tbname in varchar2,v_part in varchar2,rnv_date in varchar2,v_tabs in varchar2) isrnv_sql1 varchar2(200);rnv_sql2 varchar2(200);rnv_dtime date;rnbeginrn v_dtime:=to_date(v_date,'yyyy-mm-dd hh24:mi:ss');rn dbms_output.put_line(v_dtime);rn v_sql2:='alter table '||v_tbname||' add partition '||v_part||' values less than ('||v_dtime||') tablespace '||v_tabs||'';rn dbms_output.put_line(v_sql2);rn execute immediate v_sql2;rnend addpart;rnrn[/code]rnexec addpart('mytest','p_04','2009-04-01 0:00:00','P_TEST');--表名,范围分区名,时间,表空间rn执行的结果如下:rn01-4月 -09rnalter table mytest add partition p_04 values less than (01-4月 -09) tablespace P_TESTrnbegin addpart('mytest','p_04','2009-04-01 0:00:00','P_TEST'); end;rnORA-00907: 缺失右括号rnrn现将rnalter table mytest add partition p_04 values less than (to_date('2009-04-01 0:00:00','yyyy-mm-dd hh24:mi:ss')) tablespace P_TESTrn在plsql 中执行通过 rnrnrn向各位请教,存储过程该如何改进下。。。
orcal 建表 缺失右括号 怎么弄?
create table T_KP_USERSrn(rn ID numeric(6) not null auto_increment comment '用户ID',rn USERNAME varchar(30) not null comment '用户名称',rn PASSWD varchar(32) not null comment '密码',rn NAME varchar(30),rn SEX varchar(1) comment '1:男rn 2:女',rn PHONE varchar(30),rn SYSTMID varchar(20) comment '所属哪个系统rn 1:监控rn 2:企业在线rn 3:动态稽查rn 4:营运分析rn 5:系统管理rn 6:信息发布rn 7:服务质量信息考核',rn ROLE_ID numeric(6) not null comment '角色ID',rn ID_OWNER numeric(18),rn USER_STAT varchar(1) not null comment '0:注销状态rn 1:正常状态',rn MEMO VARCHAR2(200) comment '备注',rn CJSJ datetime,rn CJCZY varchar(30),rn ZHDLSJ datetime,rn ZHDLIP varchar(15),rn primary key (ID)rn)rntablespace TS_BUSI;
插入一条数据库语句报[Error Code: 907, SQL State: 42000] ORA-00907: 缺失右括号
create table tbagreement (rn "contract_no" VARCHAR(26) not null default ' ',rn "in_client_no" VARCHAR(20) not null default ' ',rn "bank_no" VARCHAR(2) not null default ' ',rn "prd_manager" VARCHAR(6) not null default ' ',rn "trans_date" INTEGER not null default '0',rn "trans_time" INTEGER not null default '0',rn "channel" VARCHAR(1) not null default ' ',rn "oper_no" VARCHAR(32) not null default ' ',rn "branch_no" VARCHAR(16) not null default ' ',rn "close_date" INTEGER not null default '0',rn "status" VARCHAR(1) not null default ' ',rn "reserve" VARCHAR(250) not null default ' ',rn constraint PK_TBAGREEMENT primary key ("contract_no")rn);rn
急 oracle数据库 出现ORA-00907: 缺少右括号 在线等
实在不知道 啥原因rnrnORA-00907: 缺少右括号 rn说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。 rnrn异常详细信息: System.Data.OleDb.OleDbException: ORA-00907: 缺少右括号rnrn源错误: rnrnrn行 20: 'Dim cmd1 As New Data.SqlClient.SqlCommand("select userid,username,truename, online,(select count(id) from chat where dusername='" & Trim(Session.Item("curuser_username")) & "' and susername=qx_users.username and readed='0') as msgcount from qx_users order by online desc", connmy)rn行 21: Me.TblUser.Rows.Clear()rn行 22: Using dr1 As OleDb.OleDbDataReader = cmd1.ExecuteReaderrn行 23: Do While dr1.Readrn行 24: Dim row1 As New TableRowrn rnrn源文件: E:\厦门车管\CLJSGL\Chatmain.aspx.vb 行: 22 rnrn堆栈跟踪: rnrnrn[OleDbException (0x80040e14): ORA-00907: 缺少右括号]rn System.Data.OleDb.OleDbCommand.ExecuteCommandTextForMultpleResults(tagDBPARAMS dbParams, Object& executeResult) +114rn System.Data.OleDb.OleDbCommand.ExecuteCommandText(Object& executeResult) +163rn System.Data.OleDb.OleDbCommand.ExecuteCommand(CommandBehavior behavior, Object& executeResult) +56rn System.Data.OleDb.OleDbCommand.ExecuteReaderInternal(CommandBehavior behavior, String method) +105rn System.Data.OleDb.OleDbCommand.ExecuteReader(CommandBehavior behavior) +92rn System.Data.OleDb.OleDbCommand.ExecuteReader() +6rn Chartmain.LoadUserList() in E:\厦门车管\CLJSGL\Chatmain.aspx.vb:22rn Chartmain.Page_Load(Object sender, EventArgs e) in E:\厦门车管\CLJSGL\Chatmain.aspx.vb:62rn System.Web.UI.Control.OnLoad(EventArgs e) +80rn System.Web.UI.Control.LoadRecursive() +49rn System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3750rnrn
ORA-00907: 缺失右括号;代码我在sql运行中都正确,但到了idea中就报错
这代码我在sql运行中都正确,但到了idea中就报错 我觉得是子查询中那个order by的毛病,但分页语法必须有 SELECT PP.EMP_CODE, E.NAME, PP.EMP_SEQ_NUM, PP.ORG_NAME, PP.EMP_PROPERTY, PP.EMP_TYPE, PP.EMP_ORG_ID, PP.ID FROM (SELECT T.ID, T.IS_DELETED, T...
ORA-00907: 缺少右括号??TOAD,SQL*Plus里能执行
C#,ASP。NET里面不能执行,如下SQL,奇怪。。。。。。。rn[code=SQL]select METERID,DEVICETYPE,max(case when TO_CHAR(DDATE,'yyyymmdd') =TO_CHAR(TO_DATE('2010-4-17','yyyy-mm-dd'),'yyyymmdd') then nvl(METERNLLJ,0) else 0 end) as data1,max(case when TO_CHAR(DDATE,'yyyymmdd') = TO_CHAR(TO_DATE('2010-4-18','yyyy-mm-dd'),'yyyymmdd') then nvl(METERNLLJ,0) else 0 end) as data2,(max(case when TO_CHAR(DDATE,'yyyymmdd') = TO_CHAR(TO_DATE('2010-4-18','yyyy-mm-dd'),'yyyymmdd') then nvl(METERNLLJ,0) else 0 end)-max(case when TO_CHAR(DDATE,'yyyymmdd') = TO_CHAR(TO_DATE('2010-4-17','yyyy-mm-dd'),'yyyymmdd') then nvl(METERNLLJ,0) else 0 end)) as METERNLLJ,max(case when TO_CHAR(DDATE,'yyyymmdd') = TO_CHAR(TO_DATE('2010-4-17','yyyy-mm-dd'),'yyyymmdd') then DEVICESTATUS else 0 end) as DEVICESTATUS1,max(case when TO_CHAR(DDATE,'yyyymmdd') = TO_CHAR(TO_DATE('2010-4-18','yyyy-mm-dd'),'yyyymmdd') then DEVICESTATUS else 0 end) as DEVICESTATUS2 from TMPTODAY WHERE DEVICETYPE=16 AND METERID IN (SELECT METERNO FROM TDOOR_METER WHERE METERTYPE=16 ) group by METERID, DEVICETYPE[/code]
oracle删除表数据时 ORA-00907: 缺少右括号
sql语句:delete from test.tableA;rn就提示:ORA-00907: 缺少右括号rn我不懂,我哪写错了?~~
在oracle中建表出现ORA-00907: 缺少右括号错误,
SQL> create table yangou(rn 2 id int(32) not null primary key,rn 3 name varchar(30) not null);rnrnid int(32) not null primary key,rn *rnERROR 位于第 2 行:rnORA-00907: 缺少右括号rn这是我的建表代码,刚学oracle,请大家帮忙,谢谢rncreate table yangou(rn 2 id varchar(32) not null primary key,rn 3 name varchar(30) not null);如果是这样的,就没有错误.rnrn
缺失的括号
缺失的括号时间限制:1秒空间限制:65536K一个完整的括号字符串定义规则如下:1、空字符串是完整的。2、如果s是完整的字符串,那么(s)也是完整的。3、如果s和t是完整的字符串,将它们连接起来形成的st也是完整的。例如,&quot;(()())&quot;, &quot;&quot;和&quot;(())()&quot;是完整的括号字符串,&quot;())(&quot;, &quot;()(&quot; 和 &quot;)&quot;是不完整的括号字符串。牛牛有一个括号字符串s,现在需要在其中任意位置尽
相关热词 c# login 居中 c# 考试软件 c# 自然语言分析 c# 分段读取文件 c# 泛型反射 c#打断点 c# 时间转多少秒 c# 线程函数加参数 c# modbus 读取 c#查询集合表