oracle查询语句老是报ORA-00907缺失右括号

--大家好,我有一条oracle查询语句老是报ORA-00907缺失右括号的错误,能不能帮我看一下,谢谢:
--统计毕业班等级考试最佳成绩
select distinct e.xy 学院,
e.xzb 班级,
e.xh 学号,
e.xm 姓名,
a.cet3 英语三级,
b.cet4 英语四级,
c.cet6 英语六级,
d.computer 计算机
from ((select xh, xm, djksmc, max(cj) cet3
from xsdjksb
where djksmc = '英语三级'
Group by xh, xm, djksmc) a,
(select xh, xm, djksmc, max(cj) cet4
from xsdjksb
where djksmc = '英语四级'
Group by xh, xm, djksmc) b,
(select xh, xm, djksmc, max(cj) cet6
from xsdjksb
where djksmc = '英语六级'
Group by xh, xm, djksmc) c,
(select xh, xm, djksmc, max(cj) computer
from xsdjksb
where djksmc like '计算机%'
Group by xh, xm, djksmc) d, xsjbxxb e)
where (a.xh = e.xh or b.xh = e.xh or c.xh = e.xh or d.xh = e.xh)
and ((e.DQSZJ = '2010' AND e.XZ = '5') OR
(e.DQSZJ = '2011' AND e.XZ = '4') OR
(e.DQSZJ = '2012' AND e.XZ = '3'))
AND e.SFZX = '是'
order by e.xy, e.xzb, e.xh, e.xm;

报错落在 djksmc) a,的a上

我确信我的语句所有的左右括号都是匹配的,没有缺失,一定是语句的语法出了问题,请大家帮我把把关,谢谢!

0

2个回答

多了个括号,from里的表不能用括号括起来

SELECT DISTINCT e.xy 学院,
e.xzb 班级,
e.xh 学号,
e.xm 姓名,
a.cet3 英语三级,
b.cet4 英语四级,
c.cet6 英语六级,
d.computer 计算机
FROM ( SELECT xh,
xm,
djksmc,
MAX (cj) cet3
FROM xsdjksb
WHERE djksmc = '英语三级'
GROUP BY xh, xm, djksmc) a,
( SELECT xh,
xm,
djksmc,
MAX (cj) cet4
FROM xsdjksb
WHERE djksmc = '英语四级'
GROUP BY xh, xm, djksmc) b,
( SELECT xh,
xm,
djksmc,
MAX (cj) cet6
FROM xsdjksb
WHERE djksmc = '英语六级'
GROUP BY xh, xm, djksmc) c,
( SELECT xh,
xm,
djksmc,
MAX (cj) computer
FROM xsdjksb
WHERE djksmc LIKE '计算机%'
GROUP BY xh, xm, djksmc) d,
xsjbxxb e
WHERE (a.xh = e.xh OR b.xh = e.xh OR c.xh = e.xh OR d.xh = e.xh)
AND ( (e.DQSZJ = '2010' AND e.XZ = '5')
OR (e.DQSZJ = '2011' AND e.XZ = '4')
OR (e.DQSZJ = '2012' AND e.XZ = '3'))
AND e.SFZX = '是'
ORDER BY e.xy,
e.xzb,
e.xh,
e.xm;

0

问题解决,确实不报错了,只是执行效率超级低下,因为它要反复比对好几个表格的学号,有什么办法优化下吗?

0
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
ORA-00907: 缺失右括号问题整理解决
ORA-00907: 缺失右括号前言        最近在开发过程中使用oracle数据库,在程序中进行查询数据时遇到了“ORA-00907: 缺失右括号”的问题,但是如果直接把sql语句直接在数据库或PL/SQL中执行时,却又能够正常查询,为了解决这个问题,折腾了半天,查找了一些资料,所以就对各种导致出现“缺失右括号”的情况进行了整理总结。行文如下。1 union all中order by 导致
ORA-00907: 缺失右括号
/* Formatted on 2018/7/17 14:59:32 (QP5 v5.256.13226.35538) */ UPDATE yl_user    SET YL_COMPANY_ID =           (  SELECT ID                FROM YL_REPAIR_SHOP               WHERE     CONTRACT_MOBILE =...
创建数据库表时,关于ORA-00907: 缺失右括号与左括号问题总结
今天使用Oracle数据库建表的时候,遇到了“ORA-00907: 缺失右括号”的问题,关于这个,做了一些总结: 报错的sql语句: create table pre_info(pre_name varchar2(20),pre_code varchar2(20),pre_num number(5),pre_price_old number(5), pre_tax decimal...
ORA-00907: 缺失右括号与左括号问题总结
在创建数据表总结如下:  1.date限定字段大小的时候,会报错,比如,将date(12)去掉(12);  2.关键字顺序有误,也会报这样的错;  3.创建表时,如果表有关键字,用双引号括起来;  4.如果创建表时,未对字段中的表设置长度,也会报错;  5.创建主外键约束时外键类型跟主键类型不完全一致,也是会报错的。  ...
oracle 使用union提示ORA-00907:缺少右括号
在使用union的时候提示:ORA-00907:缺少右括号 此原因是因为在union的左边和右边都有order by,因此需要去掉一边的order by,保留一个即可。 select * from  (  select id,name from emp order by name union  select id,name from emp )
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...
oracle数据库建表时出现错误:缺失右括号
oracle数据库建表时出现错误:缺失右括号 这个错误一般都是用了oracle中没有的语法导致的,比如:identity函数是SQLSERVER中的,oracle中不能用;数字型定义在oracle中须全写number,只写num也会报这个错误。 调试方法:逐行注释
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 缺失右括号
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请赐教
EasyUI异步分页
1.使用技术 EasyUI+servlet+c3p0+mysql 2.搭建环境                      junit             junit             4.11             test                               commons-beanutils             commons-
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
Oracle异常ORA-00907:missing right parenthesis一种情况的解决(模糊查询)
写Oracle的SQL语句时报了异常ORA-00907:missing right parenthesis,缺失右侧括号,我的sql语句如下。 检查后并没有发现括号缺失,最后问题解决,是模糊查询这里出的问题,模糊查询处改为如下这种形式,问题解决。 like '%'||#{crmCustomerInfo}||'%'  ...
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";
零基础oracle数据库学习记录第一天
打开WIN+R输入cmd再回车。 直接贴程序执行的过程。 //打开oracle sqlplus " /as sysdba" //启动数据库 startup; //关闭数据库 shutdown immediate; //创建用户 create user chu identified by chu default tablespace users Temporary TABLE
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求各位大神大牛帮帮小弟!!!!
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 >= ?nnn大神大牛帮帮忙。
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
Oracle缺失左括号错误
Oracle在创建表的时候,报了一个错误:[Err] ORA-00906: missing left parenthesis。 以下是创建表的源代码: CREATE TABLE TB_SALES_PO_FR ( "ID" NUMBER NOT NULL , "BUSINESSID" VARCHAR2 NULL , "BUSINESS" VARCHAR2(50) NULL , "WORKCOD
Oracle数据库DECODE函数的作用及使用方法
   DECODE函数是ORACLE PL/SQL的功能强大的函数之一,目前还只有ORACLE公司的SQL提供了此函数。    DECODE函数的作用:它可以将输入数值与函数中的参数列表相比较,根据输入值返回一个对应值。函数的参数列表是由若干数值及其对应结果值组成的若干序偶形式。当然,如果未能与任何一个实参序偶匹配成功,则函数也有默认的返回值。 它的语法如下:   DECODE(...
子查询in 为何不能用order by
oracle子查询中能使用order by吗 SQL code: SQL> select * from dept a 2 where a.deptno in 3 ( 4 select b.deptno from dept b 5 order by b.dname 6 ) 7 ; order by b.dname * ERROR at line 5: ORA-00907: m
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: 缺少右括号
[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后为什么格式变了呢?
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自己尝试给表里的列分别删了就留一列还是不好用,无法定位问题原因,水平比较低,肯定各位大神走过路过帮忙看看。
ORA-00906: 缺失左括号
原因: 使用PowerDesigner生成了sql脚本,在navicat下执行的时候 报了这么一个错误 . 我看网上说是类型没有指定大小.后来找到是我使用模型生成的脚本有这个问题 : constraint PK_T_CUSTOMER_ORGIN primary key clustered (ID) 这个主键的指定方式的问题 ,然后我把这个主键指定方式改成了这样:PRIMARY...
执行ORACLE SQL语句,报ora-00907 缺少右括号
select slm,substr(id,1,1) lb,sum(zajs) ajsnum,sum(wz) wznum,sum(tzz) tzznum,sum(dt) dtnum from ywk_xmxx join xtwh_struct_class on dh like 'substr(id,1,1)%' where length(slh)=2 and rnjgrq>=To_date(2010-7-1 00:00:00,'yyyy-mm-dd hh:mm:ss') and rn jgrq<=To_date(2010-10-16 23:59:59,'yyyy-mm-dd hh:mm:ss') group by slm,substr(id,1,1) rnrn请各位大侠帮忙分析下,谢谢
第 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
缺失右括号
例如:rncrate table a(id not null number(4)); 就会报错:缺少")"rn但是:rncreate table a(id number(4) not null); 就不会报错。rn为什么呢?rnnot null 一定要放到后面吗?
缺失右括号的问题??
[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]
缺失右括号问题
最近刚开始学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子查询有order by 报缺失右括号
[code=sql]select PM_MODEL_CODE,(select WD_IN_TIME from T_WIP_DETAIL where WD_MODEL_CODE=m.PM_MODEL_CODE and ROWNUM=1 order by WD_IN_TIME) WD_IN_TIMErn from T_PM_MO_BASE m group by PM_MODEL_CODE[/code]rnrn括号里我又必须按时间排序,然后取第一个,求解决方法
oracle写了个简单的分页,一直报右括号缺失
存储过程-------rncreate or replace procedure proc8(v_in_table in varchar,v_in_pagesize in number,v_in_pagenow in number,v_out_result out pack2.my_cursor) isrn 2 v_begin number(10);rn 3 v_end number(10);rn 4 v_sql varchar2(3000);rn 5 beginrn 6 v_begin:=v_in_pagesize*(v_in_pagenow-1)+1;rn 7 v_end:=v_in_pagesize*v_in_pagenow;rn 8 v_sql:='select name into v_name from (select a1.*,rownum rn from (select * from '||v_in_table||') a1 where rownum<='||v_end||' where rn>'||v_begin;rn 9 open v_out_result for v_sql;rn 10 end;rn 11 /rn rnjava程序--------rn Class.forName("oracle.jdbc.driver.OracleDriver");rn rn ct=DriverManager.getConnection("jdbc:oracle:thin:@10.1.12.184:1521:orcl","system","manager");rn cs=ct.prepareCall("call proc8(?,?,?,?)");rn cs.setString(1, "student");rn cs.setInt(2,2);rn cs.setInt(3,1);rn cs.registerOutParameter(4,oracle.jdbc.OracleTypes.CURSOR);rn cs.execute();rn rs=(ResultSet)cs.getObject(4);rn while(rs.next())rn System.out.println("name="+rs.getString("name")+" no="+rs.getInt("no"));rn rnrn错误------rnjava.sql.SQLException: ORA-00907: 缺失右括号rnORA-06512: 在 "SYSTEM.PROC8", line 9rnORA-06512: 在 line 1
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')。
使用oracle函数 LISTAGG 函数报错。ORA-00923: 未找到要求的 FROM 关键字
ORA-00923发生的原因之一是: LISTAGG(event, ‘;’) WITHIN GROUP(ORDER BY opttime)函数中分隔符为英文分号。 这算是oracle函数的一个小BUG吧。 除去英文分号外其它字符暂时没有发现问题。 ...
奇怪的问题 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: 缺少右括号 这个错误