SQL> desc subclubinfo
名称
是否为空? 类型
----------------------------------------- -------- ----------------------------
SUBCLUBNO
NOT NULL NUMBER
... ...
SQL> desc appluclub
名称
是否为空? 类型
----------------------------------------- -------- ----------------------------
SERVICEID
NOT NULL VARCHAR2(20)
... ...
SQL> select a.subclubno from(select subclubno from subclubinfo where to_char(subclubno) = '89') a
2,
3(select to_number(substr(serviceid,8)) SUBCLUBNO from JOINCLUB where serviceid like 'VVCLUB_%' group by substr(serviceid,8)) e
4where a.subclubno=e.subclubno
5/
SUBCLUBNO
----------
89
按理说subclubno本身是number型,直接写subclubno=89就可以了,但我这样写却报错
SQL> select a.subclubno from(select subclubno from subclubinfo where subclubno = 89) a
2,
3(select to_number(substr(serviceid,8)) SUBCLUBNO from JOINCLUB where serviceid like 'VVCLUB_%' group by substr(serviceid,8)) e
4* where a.subclubno=e.subclubno
*
ERROR 位于第 3 行:
ORA-01722: invalid number
请高手指教,谢谢
|