Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
How to use like and in together ?
SELECT a FROM A WHERE a LIKE (SELECT b FROM B WHERE c='india');
where column a and b are not equal but b only contains first three digits of a as shown below a=145xxxxxx; b=145;
any clue? how to achieve it?
SELECT A.a FROM A inner join B on A.a like concat(B.b,'%') and B.c = 'india'
SELECT a FROM A WHERE EXISTS (SELECT 1 FROM B WHERE c='india' AND A.a LIKE CONCAT(B.b,'%') );