select t1.id,t1.name,t1.money,(select t2.money from test1 t2 where t1.id = t2.id+1 ) MONEY1 from test1 t1;
面试题2

这里用到了组函数:wm_concat(varchar2) instr函数
string2:要在string1中查找的字符串。
start_position:从string1开始查找的位置。可选,默认为1,正数时,从左到右检索,负数时,从右到左检索。
nth_appearence:查找第几次出现string2。可选,默认为1,不能为负。
例如: select deptno,wm_concat(ename) nameslist from emp group by deptno;
select ci_id,wm_concat(stu_name) namelist from (select ci_id,stu_name from pm_ci c,pm_stu s where instr(c.stu_ids,s.stu_id) > 0) group by ci_id;

发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/173450.html原文链接:https://javaforall.net
