更新时间:2023-11-13 19:55:22
可能有几种不同的方法来做到这一点,有些比其他方法更丑陋.这是一个:
There are probably several different ways to do it, some uglier than others. Here's one:
(注:dat = 字符串)
(Note: dat = the string of characters)
select *,
substring(dat,1,charindex('-',dat)-1) as Section,
substring(dat,charindex('-',dat)+1,charindex('-',dat)-1) as TownShip,
reverse(substring(reverse(dat),0,charindex('-',reverse(dat)))) as myRange
from myTable