1. 程式人生 > >SQL擷取字串,保留後幾位

SQL擷取字串,保留後幾位

select '[2.0]Exploration and Development Department'

--想擷取掉[2.0] 只顯示Exploration and Development Department

select right('[2.0]Exploration and Development Department',len('[2.0]Exploration and Development Department')-5)
select SUBSTRING('[2.0]Exploration and Development Department',6,LEN('[2.0]Exploration and Development Department'))

---PB裡的寫法是
ls_dept = Right(string(ldw_input.object.dept_index[ll_row]), len(string(ldw_input.object.dept_index[ll_row]))-5)