cancel
Showing results for 
Search instead for 
Did you mean: 

Query - Issue using LIKE in where clause

Former Member
0 Kudos

Hi Experts,

I have facing issue while using Like in a query.

Please see the below scenario. I an trying to JOIN the two table using the mentioned fields. However since the values in the fileds isn't exactly same, I want to use LIKE to join them.

Table NameField NameData TypeField value
FCI_CS_SCORE_ATTRRFX_SCORER_OBJECT_NAMEVARCHAR(120)Jane Rux
ODP_TMP_ESO_CSSCORER_NAMEVARCHAR(360)Jane Rux (jrux)

I have tried below option but it's not working.

1. T1.SCORER_NAME LIKE T2.RFX_SCORER_OBJECT_NAME%

2.T1.SCORER_NAME LIKE T2.RFX_SCORER_OBJECT_NAME'%'

Can soemone please tell me how to use LIKE here or any other OPERAND that may help here.

Regards

Praveen

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Praveen,

PFB query which you can refer for your requirement.

select t2.display_name,t1.doc_owner_user_object_name,T2.FIRST_NAME from CLMSOURCE.FCI_CONTRACT T1,CLMSOURCE.FCI_UPP_USER_ACCOUNT T2

WHERE t1.doc_owner_user_object_name LIKE T2.FIRST_NAME||'%'

'||'-Oracle or '+'-MySQL should be used for appending based on DB you are using.

The above query worked for us as we are using Oracle DB.

Regards,

Vignesh

Former Member
0 Kudos

Thanks Vignesh, it worked. Appreciate your quick response.

0 Kudos

Hi Vignesh,

Could you provide information how to use that function in DB2?

Regards,

Dominik

Answers (0)