Re: help with sql statement doing substrings and replace

From: avinash <azodpe_at_hotmail.com>
Date: 7 Mar 2003 18:57:44 -0800
Message-ID: <4267019a.0303071857.1b4f0f46_at_posting.google.com>


Try using instr function to get the .pdf extension and then use a combination of substr and length function to get your result.

efeigenb_at_alumni.tufts.edu (Figz) wrote in message news:<3758d0a5.0303071240.659a3f24_at_posting.google.com>...
> Hi,
>
> I have columns called FILES with data like
>
> FILES
> -----------------------
> 'hello.pdf'
> 'something.pdf'
> 'noextension'
> 'test01.pdf'
> 'anotherwithnoextension'
>
> and I want to find all the ones in that column that have '%.pdf' in
> them and replace them with everything BUT the .pdf extension. So I
> would end up with:
>
> FILES
> -----------------------
> 'hello'
> 'something'
> 'noextension'
> 'test01'
> 'anotherwithnoextension'
>
> Can someone tell me a sql statement to do that? Thanks!
Received on Sat Mar 08 2003 - 03:57:44 CET

Original text of this message