my substring() function does not work
Posted: Sun Feb 15, 2009 10:23 pm
I have a table web2_access_log with a field request_uri that always has a uri as such in it:
/universe.jpg
/world.jpg
/stunning.jpg
I also have a cust database with file_names and email_addresses as such, for example:
file_names email_addresses
universe.jpg tom@yahoo.com
world.jpg jackie@hotmail.com
stunning.jpg toni@msn.com
I'm trying to get the matches between the data with the following command, and it works if I first manually remove the forward slash from each record in the web2_access_log field, but not with the following syntax:
SELECT substring( web2_access_log.request_uri
FROM 1 ), cust.file_names, cust.email_addresses
FROM web2_access_log
JOIN cust ON substring(web2_access_log.request_uri
FROM 1) = cust.file_names
I'm stumped and would appreciate any help that a guru could might spare.
Thanks!
/universe.jpg
/world.jpg
/stunning.jpg
I also have a cust database with file_names and email_addresses as such, for example:
file_names email_addresses
universe.jpg tom@yahoo.com
world.jpg jackie@hotmail.com
stunning.jpg toni@msn.com
I'm trying to get the matches between the data with the following command, and it works if I first manually remove the forward slash from each record in the web2_access_log field, but not with the following syntax:
SELECT substring( web2_access_log.request_uri
FROM 1 ), cust.file_names, cust.email_addresses
FROM web2_access_log
JOIN cust ON substring(web2_access_log.request_uri
FROM 1) = cust.file_names
I'm stumped and would appreciate any help that a guru could might spare.
Thanks!