1.将字段中字符替换
translate(string(字段),from_str(要替换的字符),to_str(换成字符));
2.查找子串位置
instr(sourceString,destString,start,appearPosition)
instr(‘源字符串’ , ‘目标字符串’ ,‘开始位置’,‘第几次出现’)
开始位置为负数,向左移
start,appearPosition默认为1,返回结果从1开始,找不到0
3.substr
substr(str,index,length)
从str index处截,截length长度
4.时间排序问题
sql中将Date 转String再按照Date排序,则db按string排序
method: order by to_date(time(string时间),‘yyyy-mm-dd’);
5.row_number() over()
row_number() over(partition by col1 order by col2) as row_num;
根据col1分组,组内根据col2排序,组内排序编号(组内连续唯一)
2564

被折叠的 条评论
为什么被折叠?



