钢铁雄心2 民国 海军:[急]请问SQL Server中查询语句!

来源:百度文库 编辑:查人人中国名人网 时间:2024/05/05 08:46:06
要写下例查询语句:

数据库有很多条记录:
如果记录中没有"/"或"*",则取完整记录,如果有"/"则取"/"前的,如果有"*"号,则取"*"号前的

select
case when charindex('/',列)>0 then left(列,charindex('/',列)-1) when charindex('*',列)>0 then left(列,charindex('*',列)-1) else 列 end
from 表