当前位置:网站首页>Usage of (case, when) in PostgreSQL
Usage of (case, when) in PostgreSQL
2022-07-03 07:50:00 【A reserved and calm man】
1.case when
(
case
when substr(starttime::varchar,0,5)='2020' then '2020 year '
when substr(starttime::varchar,0,5)='2019' then '2019 year '
when substr(starttime::varchar,0,5)='2018' then '2018 year '
when substr(starttime::varchar,0,5)='2017' then '2017 year '
when substr(starttime::varchar,0,5)='2016' then '2016 year '
when substr(starttime::varchar,0,5)='2015' then '2015 year '
when substr(starttime::varchar,0,5)='2014' then '2014 year '
when substr(starttime::varchar,0,5)='2013' then '2013 year '
when substr(starttime::varchar,0,5)='2012' then '2012 year '
when substr(starttime::varchar,0,5)='2011' then '2011 year '
when substr(starttime::varchar,0,5)='2010' then '2010 year '
when starttime is null then ' Other years ' end
) AS year
2.mybatis To determine whether a parameter is empty
<if test="geojsonString !=null and geojsonString !=''">
WHERE
st_intersects(geom,st_geomfromgeojson(#{
geojsonString}))
</if>
边栏推荐
- An article for you to understand - Manchester code
- 微软安全响应中心
- 【LeetCode】4. Best time to buy and sell stock
- LwIP learning socket (API)
- Research shows that breast cancer cells are more likely to enter the blood when patients sleep
- Unity XR realizes interaction (grasping, moving, rotating, transmitting, shooting) -pico
- Iterm2设置
- LwIP learning socket (application)
- PAT甲级 1028 List Sorting
- Pat class a 1031 Hello world for u
猜你喜欢
Go language foundation ----- 08 ----- interface
Analysis of the problems of the 7th Blue Bridge Cup single chip microcomputer provincial competition
HarmonyOS第三次培训笔记
[mindspire paper presentation] summary of training skills in AAAI long tail problem
LwIP learning socket (application)
PAT甲级 1032 Sharing
技术干货|利用昇思MindSpore复现ICCV2021 Best Paper Swin Transformer
【LeetCode】3. Merge two sorted lists · merge two ordered linked lists
PAT甲级 1028 List Sorting
Analysis of the problems of the 11th Blue Bridge Cup single chip microcomputer provincial competition
随机推荐
[MySQL 12] MySQL 8.0.18 reinitialization
Redis批量启停脚本
哪一刻你才发现青春结束了
截图工具Snipaste
Technology dry goods | luxe model for the migration of mindspore NLP model -- reading comprehension task
Partage de l'expérience du projet: mise en œuvre d'un pass optimisé pour la fusion IR de la couche mindstore
Analysis of the ninth Blue Bridge Cup single chip microcomputer provincial competition
技术干货|昇思MindSpore可变序列长度的动态Transformer已发布!
Technical dry goods Shengsi mindspire lite1.5 feature release, bringing a new end-to-end AI experience
Client server model
【LeetCode】4. Best Time to Buy and Sell Stock·股票买卖最佳时机
什么是定义?什么是声明?它们有何区别?
【MySQL 14】使用DBeaver工具远程备份及恢复MySQL数据库(Linux 环境)
Usage of requests module
技术干货|昇思MindSpore算子并行+异构并行,使能32卡训练2420亿参数模型
密西根大学张阳教授受聘中国上海交通大学客座教授(图)
Analysis of the problems of the 7th Blue Bridge Cup single chip microcomputer provincial competition
Redis配置文件
Project experience sharing: handwritten Chinese character recognition based on Shengsi mindspire
[MySQL 13] if you change your password for the first time after installing mysql, you can skip MySQL password verification to log in