brocky Posted August 6, 2008 Share Posted August 6, 2008 I have a problem with my database. I have two tables which i want to join together. However these two tables have nothing in common. I want to match up how much came from cache in log_squid to all the other data in log_dg. The wheref fields are sometimes the same and other times different. I am usually pretty good at working these things out but this one has me stumped. I know there is a MySQL LIKE statement but couldn't get that to work. Any ideas would be great. Thanks (See the attached files for some sample data) [attachment deleted by admin] Quote Link to comment Share on other sites More sharing options...
BioBob Posted August 6, 2008 Share Posted August 6, 2008 Would a LEFT, RIGHT, INNER or OUTER JOIN statement work? Quote Link to comment Share on other sites More sharing options...
brocky Posted August 6, 2008 Author Share Posted August 6, 2008 I don't see how they would be of any use. Unless someone can demonstrate that it can be used Quote Link to comment Share on other sites More sharing options...
revraz Posted August 6, 2008 Share Posted August 6, 2008 If there is nothing in common, how are you going to determine which data lines up from each table? Why not just merge the data? Quote Link to comment Share on other sites More sharing options...
brocky Posted August 6, 2008 Author Share Posted August 6, 2008 sometimes the data is in common sometimes its almost the same. Quote Link to comment Share on other sites More sharing options...
brocky Posted August 6, 2008 Author Share Posted August 6, 2008 ok i have now got them both with a common feild however when i do a join i end up with the following output: timewheref cachetimefromfhitmissssizehowwheref mimetypeurl 1218001890http://adserver2.synnex.com.au/openads/adjs.php?22041218001890192.168.100.10ALLOWED2204GEThttp://adserver2.synnex.com.au/openads/adjs.php?-http://adserver2.synnex.com.au/openads/adjs.php?n=... 1218001890http://adserver2.synnex.com.au/openads/adjs.php?19821218001890192.168.100.10ALLOWED2204GEThttp://adserver2.synnex.com.au/openads/adjs.php?-http://adserver2.synnex.com.au/openads/adjs.php?n=... 1218001890http://adserver2.synnex.com.au/openads/adjs.php?22041218001890192.168.100.10ALLOWED1982GEThttp://adserver2.synnex.com.au/openads/adjs.php?-http://adserver2.synnex.com.au/openads/adjs.php?n=... 1218001890http://adserver2.synnex.com.au/openads/adjs.php?19821218001890192.168.100.10ALLOWED1982GEThttp://adserver2.synnex.com.au/openads/adjs.php?-http://adserver2.synnex.com.au/openads/adjs.php?n=... Its doubling up on them in some spots because none of the data is unique. Does anyone no how to get it to only dispaly it once Quote Link to comment Share on other sites More sharing options...
fenway Posted August 6, 2008 Share Posted August 6, 2008 show us your query Quote Link to comment Share on other sites More sharing options...
brocky Posted August 7, 2008 Author Share Posted August 7, 2008 ok i got this sorted. i downloaded the source code and it works fine now. got to love open source Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.