56,679
社区成员
发帖
与我相关
我的任务
分享
select count(*) from A where exists(select 1 from B where BName='jay' and a.AID like '%,'+RTRIM(BID)+',%')
select count(*) from tba where (ActorsID like '%,(select K_AccountID from Account where AccountName=''登录名''),%')
我现在是这样写的。是没报错,但是查询不出来select BID from B where BName=''jay'')
--这条件是不是只有一条记录
------------满足以上条件时,不会报错
结果集存在多少记录时,必须改为子查询条件如下:
e.g.
select count(*) from A where exists(select 1 from B where BName='jay' and AID like concat('%,',BID,',%'))