
想要截取學校,應該怎么搞?學校前面的不確定,學校長度也不確定
uj5u.com熱心網友回復:
截取“畢業于”和下一個逗號之間的字符uj5u.com熱心網友回復:
自己寫一個函式處理,只要有規律就行uj5u.com熱心網友回復:
if not object_id('school') is null
drop table school
Go
Create table school([Student] nvarchar(2),[introduce] nvarchar(100))
Insert school
select N'張三',N'1988年畢業于安徽財經大學經濟學專業' union all
select N'王五',N'1988年畢業于華南師范大學教育學專業' union all
select N'李四',N'1988年畢業于北京大學語言學專業'
select substring(學校,4,charindex('學',學校)) as 學校 from (
select
SUBSTRING(introduce,charindex('畢業于',introduce),charindex('大學',introduce)-charindex('畢業于',introduce))+'大學' as 學校
from school) t1
轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/114871.html
標籤:基礎類
上一篇:求助求助,請進來看看幫幫忙
