Mysql(CAST)和Oracle(to_char)应用

Oracle to_char  mysql cast
select * from taxpayer_subject_info f, tax_land_info LEFT JOIN document d ON tax_land_info.doc_id = to_char(d.id AS CHAR)
select * from taxpayer_subject_info f, tax_land_info LEFT JOIN document d ON tax_land_info.doc_id = CAST(d.id AS CHAR) 

当有时报字符长度超出范围的时候 可以考虑CAST(d.id AS CHAR(50));

 

Mysql中

Cast(字段名 as 转换的类型 ),其中类型可以为:

CHAR[(N)] 字符型 
DATE  日期型
DATETIME  日期和时间型
DECIMAL  float型
SIGNED  int
TIME  时间型

 

Oracle中

to_char(date,'格式');

to_char(number,'格式');

to_char(salary,'$99,99');

 

上一篇:1992. 找到所有的农场组


下一篇:1.《Spatial Downscaling of MODIS Land Surface Temperature Based on Geographically Weighted Autoregres