Jump to content

[SOLVED] my substring() function does not work


bulgin

Recommended Posts

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 [email protected]

world.jpg [email protected]

stunning.jpg [email protected]

 

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 (can't do that all day long) , but not if I try to use the following formula.  What am I missing here?

 

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!

Ver 14.12 Distrib 5.0.67, for debian-linux-gnu (i486) using readline 5.2

 

It turns out that the first recommendation above, which I did try, doesn't work, but the second one did:

 

This is what worked:

 

SELECT SUBSTRING(web2_access_log.request_uri, 2)

 

thanks for the suggestion and help!

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.