如何一起使用?
SELECT a FROM A WHERE a LIKE (SELECT b FROM B WHERE c='india');
其中a和b列不相等但b仅包含a的前三位数,如下所示 A = 145xxxxxx; B = 145;
任何线索?如何实现呢?
答案 0 :(得分:1)
SELECT A.a
FROM A
inner join B on A.a like concat(B.b,'%')
and B.c = 'india'
答案 1 :(得分:0)
SELECT a FROM A
WHERE EXISTS (SELECT 1 FROM B WHERE c='india' AND A.a LIKE CONCAT(B.b,'%') );