oracle学习86-oracle之单行函数1

 

 

 

 

 

 

--全部小写 全部大写 全部首字母大写
select lower('ATGUIGUJAVA'),UPPER('ATGUIGU Java'),initcap('ATGUIGU Java')
from dual
--

 

--转换为小写查询
select * from employees
where lower(last_name)='king'

 

 

--拼接 截取 长度
select
CONCAT('hello','world'), SUBSTR('helloworld',2,4), LENGTH('helloworld')
from dual;

 

--判断字符的位置 没有返回0
select instr('helloworld','w') from dual
--在字符里面取出 去除首尾h
select trim('h'from 'hhellhoworldh') from dual

 

--员工工作月数
select employee_id,last_name,(sysdate-hire_date)/30,months_between(sysdate,hire_date)
from employees;

 

 

posted @   前端导师歌谣  阅读(19)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 25岁的心里话
· 闲置电脑爆改个人服务器(超详细) #公网映射 #Vmware虚拟网络编辑器
· 基于 Docker 搭建 FRP 内网穿透开源项目(很简单哒)
· 零经验选手,Compose 一天开发一款小游戏!
· 一起来玩mcp_server_sqlite,让AI帮你做增删改查!!
点击右上角即可分享
微信分享提示