Re: substring query

2010-06-10 Thread Aaron Savage
Sorry Jay, Here is what I came up with. select substring(substring_index(myfile,'.',-2),1,4) AS MyColumn from mydatabase group by MyColumn; That appears to yield what I need. I just need to filter out the results that do not have an extension. -Aaron On Thu, Jun 10, 2010 at 9:28 AM, Jay Bla

Re: substring query

2010-06-10 Thread Aaron Savage
Thanks Guys for you insights. It may be a little more complicated then I made it out to be. I have tried this select substring_index(myfiled,'.',-2) from mytable. This has gotten me to a good starting point. But I still have two problems. After the extension there is a space and more wording.

substring query

2010-06-10 Thread Aaron Savage
I am looking for some guidance on creating a substring query. I have a column that stores a path to a file. I would like to extract that file extension and that is it and display it on my results. However, the paths are different lengths and some extensions are 3 letter and some are 4, eq 'html'