如何实现
这样的数据:
Computer Systems/Workstations/ACER/AcerPower Series/ACER_AcerPower_F5(ACD1112).jpg
Computer Systems/Workstations/ACER/AcerPower Series/acer_apsk30(ACD1138).jpg
Accessories/Ergonomics/ERGOTRON/Wall Mounts/Ergotron_28-483-200(ERG0012).jpg
Accessories/Ergonomics/ERGOTRON/Wall Mounts/Ergotron_28-485-200(ERG0014).jpg转变成
ACER_AcerPower_F5(ACD1112).jpg
acer_apsk30(ACD1138).jpg
Ergotron_28-483-200(ERG0012).jpg
Ergotron_28-485-200(ERG0014).jpg
就是显示文件名了,不要路径
数据类型:varchar
msSQL 7

解决方案 »

  1.   

    declare @t table(a varchar(100))
    insert into @t select 'Computer Systems/Workstations/ACER/AcerPower Series/ACER_AcerPower_F5(ACD1112).jpg'
    union all select 'Computer Systems/Workstations/ACER/AcerPower Series/acer_apsk30(ACD1138).jpg'
    union all select 'Accessories/Ergonomics/ERGOTRON/Wall Mounts/Ergotron_28-483-200(ERG0012).jpg'
    union all select 'Accessories/Ergonomics/ERGOTRON/Wall Mounts/Ergotron_28-485-200(ERG0014).jpg'select right(a,charindex('/',reverse(a))-1) from @t
      

  2.   

    没用过7.0,不知道有没有reverse函数
      

  3.   

    declare @a varchar(8000)
    select @a='Accessories/Ergonomics/ERGOTRON/Wall Mounts/Ergotron_28-485-200(ERG0014).jpg'
    select @a=right(@a,charindex('/',REVERSE(@a))-1)
    print @a