If you print the string out you'll see it has been modified and no longer matches what you're using in MySql, instead:
my $query = 'SELECT DISTINCT SUBSTRING_INDEX(SUBSTRING_INDEX(path, "\\ +\\", -2), "\\\\", 1) AS dir FROM files';
In reply to Re: DBI mysql substring_index syntax error
by Loops
in thread DBI mysql substring_index syntax error
by Rodster001
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |