Jump to content

Join Exact Matches only


Ramacide

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?

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.