关于子查询
select a1.calldate , a1.src , a1.dst ,a1.billsec
, (select accountNumber from poicomcce.customer b1 where a1.dst like "%"+b1.Phone+"%" ) accountNumber
from asterisk.ast_cdr a1
where src in (2602,2615,2636) limit 200
红字部份我想要做模糊查询,应该怎样写呢?请指点,谢谢
[最优解释]
where charindex(b1.Phone,a1.dst) > 0
[其他解释]
select a1.calldate , a1.src , a1.dst ,a1.billsec
, (select accountNumber from poicomcce.customer b1 where a1.dst like '%'+b1.Phone+'%' ) accountNumber
from asterisk.ast_cdr a1
where src in (2602,2615,2636) limit 200
单引号的吧。你是MYSQL?
[其他解释]
limit mysql
[其他解释]
感谢问题已经解决,我用的是mysql换个方法就行了!