select
a.id,a.name,a.dept_id,b.name,b.name_path, reverse( left( reverse(b.name_path),locate('→' , reverse(b.name_path) )-1) ) ,reverse(substring(reverse(b.name_path),locate('→' , reverse(b.name_path) )+1,length(b.name_path))),1
from(
select
id,name,dept_id
from
security_org_position where data_state=1 and `name`='文秘'
) a inner join security_org_department b on a.dept_id=b.id where b.data_state=1 and b.level2!=30000 and b.level3=3 ;
reverse( left( reverse(b.name_path),locate('→' , reverse(b.name_path) )-1) ) 反轉順序獲取第一次符號出現的位置擷取
reverse(substring(reverse(b.name_path),locate('→' , reverse(b.name_path) )+1,length(b.name_path))) 反轉獲取特殊符號第一次出現的位置,從指定位置獲取符號前面的資料
esnext 最後乙個引數後面也允許加逗號了
目前是乙個 stage 3 的提案,chakra 和 jsc 已經實現了,它允許我們在函式定義時的最後乙個形參和函式呼叫時的最後乙個實參的尾部加上逗號。注意 最後乙個引數加逗號的優點只在引數分行寫時才能體現出來。優點1 修改 時不容易出錯 假如當前的 長這樣 function foo param1,...
乙個取分頁sql函式
public static string getpageinfosql int top,int page,string sql string addwhere if sql.indexof from 1 addwhere sql.substring sql.indexof from addwhere...
有關於String型別如何擷取最後乙個小數點的資料
substring int beginindex 這個方法的根本就是擷取字串 if beginindex 0 int sublen value.length beginindex if sublen 0 return beginindex 0 this new string value,begini...