Ramacide Posted April 12, 2011 Share Posted April 12, 2011 Hello, MySQL 5.1.49 I am unable to figure out how to make two tables result only in exact matches. Here is my current query. $query_this = " SELECT * FROM M_P RIGHT JOIN I_I ON I_I.m = M_P.Mc "; In the table below, I am only wanting to pull "img" and it is pulling everything with img in it. | Mc | name |description| +-------+--------------------+------------+ | img | me 1 | des 1 | | img1 | me 1 | des 1 | | img2 | me 2 | des 2 | | img3 | me 3 | des 3 | +-------+-------------------+-------------+ Quote Link to comment https://forums.phpfreaks.com/topic/233536-join-exact-matches-only/ Share on other sites More sharing options...
requinix Posted April 12, 2011 Share Posted April 12, 2011 It's pulling everything, regardless of whether it has "img" in it. ... WHERE whatevertheheckthatfieldissupposedtobe = "img" Quote Link to comment https://forums.phpfreaks.com/topic/233536-join-exact-matches-only/#findComment-1200860 Share on other sites More sharing options...
Ramacide Posted April 13, 2011 Author Share Posted April 13, 2011 Thank you for the response; however, I am wanting to it to join on multiple values based on what is pulled from table 1. Lets say Table 1 has img and img2 specified, it's going to pull all img. There isn't a way to force join to only join by exact match instead of a partial? Quote Link to comment https://forums.phpfreaks.com/topic/233536-join-exact-matches-only/#findComment-1200899 Share on other sites More sharing options...
kickstart Posted April 13, 2011 Share Posted April 13, 2011 Hi It will match on the full match. Matching on a partial match would be far harder. All the best Keith Quote Link to comment https://forums.phpfreaks.com/topic/233536-join-exact-matches-only/#findComment-1201001 Share on other sites More sharing options...
Ramacide Posted April 13, 2011 Author Share Posted April 13, 2011 Thank you both for your assistance. I am going to use a different method/route to create the desired effect. Quote Link to comment https://forums.phpfreaks.com/topic/233536-join-exact-matches-only/#findComment-1201086 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.