当前位置:网站首页>Oracle 常用基础函数
Oracle 常用基础函数
2022-06-28 05:21:00 【辕小白】
基础函数
- ABS函数 :取n的绝对值。
- CONCAT函数:字符串拼接,与||效果相同。
- INITCAP函数:将单词的首字母以大写的方式返回,其他小写。单词由空格、控制字符、标点符号限制
- INSTR 函数:查找l字符,首个l位于第3个位置。
- LENGTH 、LENGTHB函数:LENGTH 返回字符串的长度、LENGTHB 返回字节的长度。
- LPAD 函数:string 准备填充的字符串
- TRIM函数:移除字符串两侧的空白字符或其他预定义字符。
- REPLACE 函数:‘将要更改的字符串’,‘被替换掉的字符串’,’[替换字符串]’。
- TRUNC函数:TRUNC(NUMBER)表示截断数字,TRUNC(date)表示截断日期。
- 10.SUBSTR()函数:substr(字符串,截取开始位置,截取长度)。

union all函数使用
- Union:对两个结果集进行并集操作,不包括重复行,同时进行默认规则的排序;
- Union All:对两个结果集进行并集操作,包括重复行,不进行排序;
- union和union all的区别是,union会自动压缩多个结果集合中的重复结果,而union all则将所有的结果全部显示出来,不管是不是重复。Union All 速度比Union快。

oracle行转列、列转行
1.行转列
- 方法一:Oracle中的Pivot函数
- 方法二:聚合函数(max)结合decode函数
- 方法三:使用聚合函数(max)结合case when 函数
2.列转行
- 方法一:Oracle中的unpivot函数
- 方法二:使用union all方法

边栏推荐
猜你喜欢

【Linux】——使用xshell在Linux上安装MySQL及实现Webapp的部署

2022 new version NFT source code source code of China meta universe digital collection art trading platform

2022 safety officer-b certificate examination question bank and answers
![[Linux] - using xshell to install MySQL on Linux and realize the deployment of webapp](/img/07/e044a6ef14a6576dbee1c6a009ab4f.png)
[Linux] - using xshell to install MySQL on Linux and realize the deployment of webapp

Deeplearning ai-week1-quiz

MySQL export database dictionary to excel file

Extjs library management system source code intelligent library management system source code

CPG 固体支持物研究:Lumiprobe通用 CPG II 型

The short video local life section has become popular. How to grasp the new opportunities?

【LeetCode】12、整数转罗马数字
随机推荐
Disable right-click, keyboard open console events
!‘ Cat 'is not an internal or external command, nor is it a runnable program or batch file.
【C语言练习——打印空心正方形及其变形】
A guide to P2P network penetration (stun) for metartc5.0 programming
【JVM系列】JVM调优
Extjs library management system source code intelligent library management system source code
高通平台 Camera 之 MCLK 配置
Function reentry caused by Keil C51's data overlaying mechanism
氨基染料研究:Lumiprobe FAM 胺,6-异构体
2022 special operation certificate examination question bank and simulation examination for safety management personnel of fireworks and firecrackers business units
2022 Western pastry (Advanced) test question simulation test platform operation
项目经理考完PMP就够了?不是的!
Dart学习——函数、类
Feign implements path escape through custom annotations
Camera Basics
It is the latest weapon to cross the blockade. It is one of the fastest ladders.
Have you finished the examination of level II cost engineer? There are also qualification regulations!
Concurrent wait/notify description
Jdbc的使用
Pcr/qpcr research: lumiprobe dsgreen is used for real-time PCR