当前位置:网站首页>Spark-SQL中根据年月日显示周几用date_format(date,‘u‘)
Spark-SQL中根据年月日显示周几用date_format(date,‘u‘)
2022-07-26 01:25:00 【大数据小王】
====SparkSQL中
select date_format(now(),'u')
select date_format('2022-07-02','u')
结果==》6
select date_format('2022-07-03','u')
结果==》7
select date_format('2022-07-04','u')
结果==》1
select date_format('2022-07-05','u')
结果==》2
select date_format('2022-07-06','u')
结果==》3
select date_format('2022-07-07','u')
结果==》4
select date_format('2022-07-08','u')
结果==》5注意:
select date_format('2022-07-02','u')
结果==》6
date_format(date,'u')函数hivesql和sparksql均支持,但是mysql和doris以及prestosql均不支持
例:
select instr("abc", "b");
结果==》2
select date_format('2022-07-22','u')
结果==》5
select instr('1-2-3-4-5-6-7',date_format('2022-07-22', 'u'))
结果==》9
select instr('1-2-3-4-5-6-7',date_format('2022-07-22', 'u'))>0
结果==》true
边栏推荐
- Dijkstra find the shortest path
- Leetcode 537. complex multiplication (netizens' thoughts, ashamed)
- Centrosymmetric binary mode cslbp, matlab
- 1.30 upgrade bin file, add suffix and file length
- Leetcode 537. 复数乘法(网友思路,自愧不如)
- Kubernetes Pod启动流程
- [Unity] 二维洞穴地图随机生成
- Mulda: a multilingual data augmentation framework for low resource cross linguistic ner reading notes
- [CTF] crypto preliminary basic outline
- Tutorial on principles and applications of database system (054) -- MySQL query (16): usage of date time function
猜你喜欢

Easyrecovery15 data recovery software with high recovery rate and high download volume

MulDA: A Multilingual Data Augmentation Framework for Low-Resource Cross-Lingual NER 阅读笔记

What should I do when my blog is attacked by hackers?

网络文件传输之零拷贝

EasyRecovery15下载量高的恢复率高的数据恢复软件

1.30 升级bin文件添加后缀及文件长度

格式化JS代码,调试JS代码

U++学习笔记 UStruct、UEnum声明以及函数库简单函数实现

How accurate is the IP address? What are dynamic IP and static IP? The most common method of switching IP

Docker advanced -mysql master-slave replication
随机推荐
iNFTnews | 假如这是元宇宙20年后的样子
The gym closes 8000 stores a year. How does the studio that bucks the trend and makes profits open?
Two stage submission and three stage submission
全国一半人跑长沙,长沙一半人跑哪?
Special topic of distributed micro service e-commerce (I) - Project Introduction
Tutorial on principles and applications of database system (055) -- MySQL query (XVII): usage of mathematical functions
MDK编译过程及ARM编译工具链
[ickim 2022] the Fourth International Conference on knowledge and information management
《分布式微服务电商》专题(一)-项目简介
# 浏览器开发使用技巧
C语言进阶(一)动态分配内存
Test questions and answers of the latest Beijing Construction eight (materialman) mock examination in 2022
B - Krypton Factor (dfs+ backtracking method)
4QAM、16QAM 调制与解调仿真电路,观察并分析QAM星座图和误码率曲线【matlab代码】
聚势|海泰方圆亮相第五届数字中国建设峰会
言语理解中心理解总结
机器学习:贝叶斯网络
Mulda: a multilingual data augmentation framework for low resource cross linguistic ner reading notes
1.30 upgrade bin file, add suffix and file length
Is it safe to open an account for stock speculation through the online account manager?