现代曲辕犁:[急]请问SQL Server中查询语句!

来源:百度文库 编辑:神马品牌网 时间:2024/04/29 19:28:00
要写下例查询语句:

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

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