Skip to main content
Hi,

 

 

I want to query records of table A where the value of X contain value of Y in table B:

 

select * from A,B where X LIKE '%Y%'

 

It output nothing, I think the problem is the quote make Y into a normal string.

 

 

How to solve this?

 

 

Thanks

 

 
Hi,

 

 

Characters within single quotes will be interpreted literally. I think this statement generates your intended result.

 

-----

 

select * from A,B where X like '%'||Y||'%'

 

-----

 

 

Takashi
Hi,

 

 

Thank you, Takashi. It works.

 

 

I just find the search result of Knowledge Center is different from Communit Answers. I didn't find your last answer when I search with the toolbar of Knowledge Center.

Reply