美文网首页
2022-03-07 转换函数

2022-03-07 转换函数

作者: Denholm | 来源:发表于2022-03-07 17:21 被阅读0次
------------转换函数----------------

/*
类似于java中的强转
公式:
cast(表达式 as 数据类型)
*/

-- double转int
select cast(12.34 as int);

-- string转int
select cast('1234' as int) + 10;

-- string转日期
select cast('2020-12-23' as date);

相关文章

网友评论

      本文标题:2022-03-07 转换函数

      本文链接:https://www.haomeiwen.com/subject/lyynrrtx.html