I have a field that contains windows file paths, like so:
\\fs1\foo\bar\snafu.txt
c:\this\is\why\i\drink\snafu.txt
\\fs2\bippity\baz.zip
\\fs3\boppity\boo\baz.zip
c:\users\chris\donut.c
What I need to do is find then number of duplicated files names (regardless of what directory they are in). So I want to find "snafu.txt" and "baz.zip", but not donut.c.
Is there a way in PostgreSQL (8.4) to find the last part of a file path? If I can do that, then I can use count/group to find my problem children.