这样写IF 一直报错有没有大佬知道PSQL写法啊
参考https://www.jianshu.com/p/59e72e2f8866
用case when end
https://blog.csdn.net/weixin_34306593/article/details/91820183?utm_medium=distribute.pc_aggpage_search_result.none-task-blog-2~aggregatepage~first_rank_ecpm_v1~rank_v31_ecpm-1-91820183.pc_agg_new_rank&utm_term=postgresql+%E5%88%A4%E6%96%AD%E8%AF%AD%E5%8F%A5&spm=1000.2123.3001.4430