Select A.CUST_ID, A.CUST_FNAME
From BANK_CUSTOMER A
Where A.CUST_TYPE=’IND’
And A.CUST_ID in (select CUST_ID from BANK_CUST_CONTACT where CONTACT_TYPE =’OFFICE’);
我遇到错误
java.sql.SQLSyntaxErrorException:ORA-00933:SQL命令不正确 结束
答案 0 :(得分:0)
有两种可能性
;
,然后尝试否则查询没有问题
答案 1 :(得分:0)
您使用的是单引号:
Select A.CUST_ID, A.CUST_FNAME
From BANK_CUSTOMER A
Where A.CUST_TYPE=’IND’ --> here
And A.CUST_ID in (select CUST_ID
from BANK_CUST_CONTACT
where CONTACT_TYPE =’OFFICE’); --> here
使用正常个:
Select A.CUST_ID, A.CUST_FNAME
From BANK_CUSTOMER A
Where A.CUST_TYPE='IND' --> here
And A.CUST_ID in (select CUST_ID
from BANK_CUST_CONTACT
where CONTACT_TYPE = 'OFFICE'); --> here
通常在复制/粘贴从MS Word或类似文本编辑器编写的代码时发生。