I have two tables: table A has certain fields, including its primary key Id
; in the development they have table B with a field with which table A is related (conceptually, since there is no relationship created in the database).
In certain records of B, the field id_Item_A
has different ids separated by commas (the development is like this and I can not change it). I would like to know if there is a way to do a INNER JOIN
that would bring me the fields of the A's Id that are in B.
Tabla A:
******************
**|id|***|Item |**
******************
**|1 |***|item1|**
**|2 |***|item2|**
**|3 |***|item3|**
Tabla B:
********************************
**|id***|id_Item_A|***|elemento|
********************************
**|1 |***| 1,2 |***|elemento1|
**|2 |***| 2,3 |***|elemento2|
**|3 |***| 1,3 |***|elemento3|
This is the example for the tables that I have. So, I would like to know if it is possible to do a INNER JOIN
and that, for example, in elemento2
tell me that it is related to Item2
e Item3
.
Thank you.