I have a table with two fields and I want to draw the matches in another field from another table. One field is the beginning and the other the end of the same field.
Table1
-
CampoA
can end or not with_
-
CampoB
always starts with_
For example:
CampoA CampoB CampoC
-------------------------------
HOLA_ _ADIOS 1
HOLA _BYE 2
HOLA _ADIOS 3
Table2
CampoAB
---------------------------
HOLA_1S_ADIOS
HOLA_ADIOS
HOLA_BYE
The result I need would be:
CampoAB CampoC
-------------------------------
HOLA_ADIOS 1
HOLA_1S_ADIOS 2
HOLA_BYE 3
The simplest thing, looking for likes does not work, because when it's HELLO, it's also HELLO _
I tried to create the string to search by like "like concat (field1," \ ", field2). With regexp I have searched for the hello with and without" "to search in two phases .
I'm trying different ways, in the end the more functions I use the slower the search becomes. If someone could help me, or tell me which is the best way.
Thanks