select file_type,cdr_name,cdr_count from monitor_delay where cdr_count > '20000';
查出如下结果
GPRS 20101217 5699cdr_count varchar2(20)
而我用select file_type,cdr_name,cdr_count from monitor_delay where cdr_count > 20000;查出的结果为空 '20000'是个char型吧 20000是个number型吧
现在的问题是 char varchar2 number 这3种类型时如何转换的
查出如下结果
GPRS 20101217 5699cdr_count varchar2(20)
而我用select file_type,cdr_name,cdr_count from monitor_delay where cdr_count > 20000;查出的结果为空 '20000'是个char型吧 20000是个number型吧
现在的问题是 char varchar2 number 这3种类型时如何转换的
Oracle converts the argument to the accepted datatype.
(如果调用函数或过程等时,如果输入参数的数据类型与函数或者过程定义的参数数据类型不一直,则oracle会把输入参数的数据类型转换为函数或者过程定义的数据类型)6) When making assignments, Oracle converts the value on the right side of the equal sign (=) to the datatype of the target of the assignment on the left side(赋值时,oracle会把等号右边的数据类型转换为左边的数据类型).7) During concatenation operations, Oracle converts from noncharacter datatypes to CHAR or NCHAR(用连接操作符(||)时,oracle会把非字符类型的数据转换为字符类型).8) During arithmetic operations on and comparisons between character and noncharacter datatypes,
Oracle converts from any character datatype to a number, date, or rowid, as appropriate.
In arithmetic operations between CHAR/VARCHAR2 and NCHAR/NVARCHAR2, Oracle converts to a number.9) Comparisons between CHAR/VARCHAR2 and NCHAR/NVARCHAR2 types may entail different character sets.
The default direction of conversion in such cases is from the database character set to the national character set.