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
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
Best answer by takashi
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
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.