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] Link to comment https://forums.phpfreaks.com/topic/118386-solved-mysql-join-isue/ 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? Link to comment https://forums.phpfreaks.com/topic/118386-solved-mysql-join-isue/#findComment-609266 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 Link to comment https://forums.phpfreaks.com/topic/118386-solved-mysql-join-isue/#findComment-609288 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? Link to comment https://forums.phpfreaks.com/topic/118386-solved-mysql-join-isue/#findComment-609323 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. Link to comment https://forums.phpfreaks.com/topic/118386-solved-mysql-join-isue/#findComment-609334 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 Link to comment https://forums.phpfreaks.com/topic/118386-solved-mysql-join-isue/#findComment-609350 Share on other sites More sharing options...
fenway Posted August 6, 2008 Share Posted August 6, 2008 show us your query Link to comment https://forums.phpfreaks.com/topic/118386-solved-mysql-join-isue/#findComment-609587 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 Link to comment https://forums.phpfreaks.com/topic/118386-solved-mysql-join-isue/#findComment-610603 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.