
在sql语句中 若表A里的一列数据在表B中存在 则在表B中增加一列并标识出来
1个回答
展开全部
只能在B中先增加一列来表示是否存在于A表中 使用flag来表示 1表示存在
select count(*) num from B where B.* = (select A.* num from A)
if(num>0) then flag=1;
select count(*) num from B where B.* = (select A.* num from A)
if(num>0) then flag=1;
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询