hivesql,sql 函数总结:

1、NVL函数与Coalesce差异

-- select nvl(null,8); -- 结果是 8

-- select nvl('',7); -- 结果是""

-- select coalesce(null,null,9); -- 结果是 9

-- select coalesce("",null,9); -- 结果是 ""

1.2、

NVL函数与Coalesce差异 - 知乎Oracle中函数以前介绍的字符串处理,日期函数,数学函数,以及转换函数等等,还有一类函数是通用函数。主要有:NVL,NVL2,NULLIF,COALESCE,这几个函数用在各个类型上都可以。 下面简单介绍一下几个函数的用法。 在...https://zhuanlan.zhihu.com/p/474789591

1.3、NVL和COALESCE的区别_coalesce函数-CSDN博客文章浏览阅读3.7k次,点赞5次,收藏27次。nvl:支持两个参数。其本质是个函数。coalesce:如果第一个参数为空就取第二个参数的值,第二个参数可以为常数也可以为表达式(字段,语句等)。以此类推,支持多个参数。更常用,其本质是个语句,更像个if语句,效率更高,建议使用。_coalesce函数https://blog.csdn.net/Allenzyg/article/details/128032686

2、hive 库、表、数据的增删改查语法

hive 库、表、数据的增删改查语法_hive修改数据_BigData_mie的博客-CSDN博客文章浏览阅读407次。【代码】hive 库、表、数据的增删改查语法。_hive修改数据https://blog.csdn.net/BigData_mie/article/details/129101216

3、insert into 与 insert overwrite 在hivesql中的用法

python 复制代码
-- create table test_kuming_202311041520.students 
-- ( id bigint, name string);

-- select *  from  test_kuming_202311041520.students;

-- drop  table test_kuming_202311041520.students;

-- insert into test_kuming_202311041520.students (id,name) values(1,"yyyy")

---- insert  into 加不加表名,都可以。
-- insert into test_kuming_202311041520.students (id,name) values(12,"wwww")

-- insert into  table test_kuming_202311041520.students (id,name) values(52,"9999")  

---- overwrite 的错误用法
-- insert overwrite  table test_kuming_202311041520.students (id,name) values(52,"9999")  --  这样操作是错误的;

-- overwrite 的正确用法
-- insert overwrite  table  test_kuming_202311041520.students
-- select * from test_kuming_202311041520.students  where id = '1'

4、

5、

6、

7、

相关推荐
AOwhisky30 分钟前
Redis 学习笔记(第一期):概述、安装配置与核心理论
运维·数据库·redis·笔记·学习·云计算
ytttr87338 分钟前
C# 定时数据库备份工具
开发语言·数据库·c#
睡不醒男孩0308231 小时前
自建 Prometheus+Grafana 与 CLUP 深度监控 PG 集群有什么区别?
数据库·oracle
就叫_这个吧1 小时前
IDEA Mybatis xml文件,实现sql语句联想,自动填入补充
xml·mysql·intellij-idea·mybatis
AOwhisky1 小时前
Redis 学习笔记(第四期):高可用与集群(哨兵 + Cluster + 容器化)
linux·运维·数据库·redis·笔记·学习·缓存
猫猫聚会Ing1 小时前
数据库设计 Prompt 提示词 - 构建与迭代
数据库
上海云盾-小余1 小时前
源站隐藏实战:规避裸 IP 被直接攻击的完整方案
数据库·网络协议·tcp/ip
微学AI2 小时前
时序大模型 TimechoAI 赋能工业时序数据底层技术优势与实操
数据库·大模型·时序大模型
北顾笙9802 小时前
MYSQL-day03
数据库·sql·mysql
MXsoft6182 小时前
**混合云统一监控实践:私有云+公有云的一体化运维方案**
运维·网络·数据库