Jump to content

Recommended Posts

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  |

+-------+-------------------+-------------+

Link to comment
https://forums.phpfreaks.com/topic/233536-join-exact-matches-only/
Share on other sites

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?

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.