时间:2021-07-01 10:21:17 帮助过:3人阅读
str1=‘abcdefg‘ substr(str1,1,3)=‘abc‘ left(str1,3)=‘abc‘ right(str1,3)=‘efg‘3.sql选择判断
select case when str1 is null then ‘abcd‘ when str1=‘123‘ then ‘efgh‘ else ‘who‘ end from tablename;实例:
SELECT CASE WHEN TRANS_REMARK IS NOT NULL THEN LEFT(TRANS_REMARK,6) ELSE NEXTVAL FOR UPPSEQ1,‘CORE‘ AS FUNDCHANNELCODE,TRANS_SEQNO,CONCAT(LEFT(TRANS_DATE,4),RIGHT(TRANS_REMARK,10)),TRANS_STATUS FROM OT_TRANS;
数据库常用函数整理
标签:blog core start sel span bst logs next 字符串