当前位置:网站首页>纵向求最大最小与横向求最大最小greatest(),least(),max(),min()
纵向求最大最小与横向求最大最小greatest(),least(),max(),min()
2022-06-22 05:47:00 【微亮之海】
greatest (a,b,c,d,e)
greatest 求的是某几列的最大值,横向求最大(一行的多列记录求最大)
注意:a,b,c,d,e列中不能出现null值,否则greatest()返回值为null值
select
greatest(
nvl(substr(a.update_time,1,10),0),nvl(substr(b.dt_editdate,1,10),0),nvl(substr(coalesce(c.editdate,c.adddate),1,10),0)
,nvl(substr(e.update_time,1,10),0),nvl(substr(f.update_time,1,10),0),nvl(substr(g.update_time,1,10),0)) update_time
from statistics.corp_basic_info_ods a
left join usercenter.ucenter_company_ods b on a.tax_num = b.c_taxnum
left join orderdb.orders_ods c on a.tax_num = c.buyer_taxnum
left join statistics.corp_deliver_config_info_ods e on a.tax_num = e.tax_num
left join statistics.corp_equip_invoice_ods f on a. tax_num = f.taxnum
left join statistics.corp_equip_invoice_sub_client_ods g on f.id = g.invoice_equipment_id
least(a,b,c,d,e)
求多列中的最小值,横向求最小
注意:a,b,c,d,e列中不能出现null值,否则greatest()返回值为null值
max(a)
求a列中的最大值
纵向求最大(一列的多行记录求最大)
min(a)
求a列中的最小值
纵向求最小(一列的多行记录求最小)
边栏推荐
- [soft test] senior system architecture designer learning experience sharing
- 402-字符串(题目:剑指Offer58-II.左旋转字符串、 28. 实现 strStr()、459.重复的子字符串)
- Serial port (RS - 232)
- 单细胞论文记录(part10)--Computational challenges and opportunities in SRT data
- 电热水壶坏了别扔,它很容易修好的!
- 单细胞论文记录(part11)--ClusterMap for multi-scale clustering analysis of spatial gene expression
- 单细胞论文记录(part14)--CoSTA: unsupervised convolutional neural network learning for ST analysis
- 单细胞论文记录(part9)--Spatial charting of single-cell transcriptomes in tissues
- Analysis on the development status of China's copper aluminum composite bus industry and Research Report on investment opportunities 2022-2027
- 论文实验记录(part1)--Detection ofnatural clusters via S-DBSCAN a Self-tuning version of DBSCAN
猜你喜欢
随机推荐
SQLServer中的子查询
Design input of Oracle project management system
Grabcut analysis
时序构成的测试平台
不务正业系列7:老照片去除斑点手法
PIR控制器调节器并网逆变器电流谐波抑制策略
Creating GLSL Shaders at Runtime in Unity3D
单细胞论文记录(part7)--DL and alignment of spatially resolved single-cell transcriptomes with Tangram
为什么我选择 Rust
【技术随记】
matlab 的离散pid控制
Use of idea plug-in EASYCODE
Test platform composed of time sequence
What about computer jam?
EPP (Enhanced Parallel Port 增强型并口)
osg编译osgQt
生信文献学习(part1)--PRECISE: a ... approach to transfer predictors of drug response from pre-clinical ...
以太网UDP帧发包设计
BinaryFormatter saving and loading game data for unity
单细胞论文记录(part10)--Computational challenges and opportunities in SRT data









