您的位置:首页 > 数据库 > Oracle

Oracle Sql相关记录

2015-09-15 11:07 656 查看
1. 批量增加数据

insert into fasp_t_carolemenu(guid, roleguid, menuguid)

select sys_guid(), guid, '43B3BF934C324381892FE59F3D244629' from Fasp_t_Carole

where length(province) = 6 and province not in (select code || '00' from V_PPP_DIST_EXT)

2. 字符/字段拼接

select id || '00' from table

3. 截取字符串

select substr('str12345678', 0, 3) from dual

一个参数为要截取的字符串;第二个参数为从哪开始截取,如果为负数,那么从最后倒数几个字符开始截取;第三个参数为,截取几位。

4. 金额格式化

select to_char(nvl(money, 0), '9,999,999,999') from table
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: